萌新求for和while用法(不方便百度,谢谢)
查看原帖
萌新求for和while用法(不方便百度,谢谢)
494933
俗人温~楼主2021/4/6 15:59
#include<iostream>
using namespace std;
int main()
{
   int shu1,shu2;
   cin>>shu1;
   for (int a=shu1;a!=0;a/10)
   {
    shu2=shu2*10+a%10;
    a/=10;
   }
   
   cout<<shu2;
   return 0;
}

之前没加上

a/=10(第十一行)

然后超时了,求for用法和while 谢

dalao

2021/4/6 15:59
加载中...