1244-请问一个正整数能够整除几次2
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int sum =0;
while(n%2==0)
{
sum++;
n=n/2;
}
cout<<sum<<endl;
return 0;
}
1062-求落地次数
#include<iostream>
using namespace std;
int main()
{
int n=100;
int sum =0;
while(n>=0.5)
{
n=n/2;
sum++;
}
cout<<sum<<endl;
return 0;
}
1254-求车速
#include<iostream>
using namespace std;
int main()
{
int n=95859;
int n1=95895;
while(true)
{
n++;
int z=n%10;
int x=n/10000%10;
int c=n/1000%10;
int v=n/10%10;
if(x==z&&c==v)
{
break;
}
}
cout<<n<<endl;
cout<<(n-n1)/2<<endl;
return 0;
}
1261-韩信点兵
#include<iostream>
using namespace std;
int main()
{
int n=1;
while(true)
{
if(n%5==1&&n%6==5&&n%7==4&&n%11==10)
{
cout<<n;
breat;
}
n++;
}
return 0;
}
1263-8除不尽的数
不会
1265-爱因斯坦的数学题
#include<iostream>
using namespace std;
int main()
{
int n=1;
while(true)
{
if(n%2==1&&n%3==2&&n%5==4&&n%6==5&&n%7==0)
{
cout<<n;
breat;
}
n++;
}
return 0;
}
1214-角谷猜想
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int sum=0;
while(n!=1)
{
if(n%2==0)
{
n=n/2;
}
else
{
n=n*3+1;
}
sum++;
}
cout<<sum;
return 0;
}
1460-小明学游泳