半透明 @ 2017-07-26 16:23:47
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
long long n1,n2,m=0;
cin>>n1;
n2=n1;
int i;
for(i=1;n1/10==0;i++)
{
n1=n1/10;
}
int a[i+2];
for(int j=1;j<=i+2;j++)
{
a[j]=n2%10;
n2=n2/10;
}
for(int k=1;k<=i+2;k++)
{
m*=10;
m=m+a[k];
}
cout<<m;
return 0;
}
by 蒻得不行 @ 2017-07-28 20:31:30
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,i,j,x,ans=0;
cin>>n;x=n;
n=abs(n);
for(i=0;n>0;i++) n/=10;
int a[i+1];n=x;
for(j=i;j>0;j--){
a[j]=n%10;
n/=10;
}x=1;
for(j=1;j<=i;j++){
ans+=a[j]*x;
x*=10;
}
cout<<ans;
return 0;
}
by Powill @ 2017-08-03 14:24:55
还有我的为啥也是20分?还有啥叫程序瘦了?
#include<cstdio>
using namespace std;
int main()
{
int m,n,a,b,c;
scanf("%d",&m);
a=m%100%10;
b=(m%100-a)/10;
c=(m-a-b)/100;
n=a*100+b*10+c;
printf("%d\n",n);
return 0;
}