0___o @ 2023-06-16 21:20:45
#include<iostream>
#include<stdio.h>
int main()
{
y=x/100;z=x/10-y*10;b=x/1-y*100-z*10;
n=x/0.1-y*1000-z*100-b*10;
printf("%d",n);
printf(".");
printf("%d%d%d",b,z,y);
return 0;
}
by CheZiHe929 @ 2023-06-16 21:23:58
没必要这么麻烦,因为除了 .
之外只有
#include<cstdio>
using namespace std;
int main(){
char a,b,c,d;
scanf("%c%c%c.%c",&a,&b,&c,&d);
printf("%c.%c%c%c",d,c,b,a);
return 0;
}
by Terrible @ 2023-06-16 21:28:54
emmm,可能
by fish_love_cat @ 2023-06-16 21:36:29
@CheZiHe929 字符串更简单()
by CheZiHe929 @ 2023-06-16 21:38:49
@fish_love_cat 的确,但你让刚入门的OIer用字符串未免难为人家了吧()。
by CheZiHe929 @ 2023-06-16 21:39:42
@fish_love_cat 不过有可能人家是巨佬()