#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
cin>>n;
int cnt = 0;
int i =1;
while(i<=n)
{
int tmp = i;
while(tmp!=0)
{
if(tmp%10 == 0)
{
cout<<tmp<<endl;
cnt++;
break;
}
tmp = tmp/10;
}
i++;
}
cout<<cnt;
return 0;
}
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
cin>>n;
int cnt = 0;
int tmp = n;
while(tmp!=0)
{
tmp = tmp/10;
cnt++;
}
cout<<cnt;
tmp = n;
int sum =0;
while(tmp!=0)
{
sum = sum*10 + tmp%10;
tmp = tmp/10;
}
int a = sum;
while(sum!=0)
{
cout<<sum%10<<"";
sum = sum/10;
}
cout<<endl<<a;
return 0;
}
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
cin>>n;
int cnt = 0;
int i = 1;
while(i!=n)
{
int tmp = i;int sum = 0;
while(tmp!=0)
{
sum = sum+tmp%10;
tmp = tmp/10;
}
if(sum == 13)
{
cout<<i<<" ";
cnt++;
}
i++;
}
cout<<endl<<cnt;
return 0;
}
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
cin>>n;
int i =1;
int cnt =0;
while(i<=n)
{
int t = i;
int sum =0;
while(t!=0)
{
sum = sum*10+t%10;
t = t/10;
}
if(i == sum)
{
cout<<i<<" ";
cnt++;
}
i++;
}
cout<<endl<<cnt;
return 0;
}
9月24日作业
于 2023-09-24 20:07:49 首次发布