求求大佬帮忙看一下有什么问题试了很多的数都正确,70分
查看原帖
求求大佬帮忙看一下有什么问题试了很多的数都正确,70分
1104314
ammmmmgoding楼主2023/10/26 18:34
#include <stdio.h>

int main() {
	int x;
	scanf("%d", &x); int ooo = x;
	if (x < 0) { x *= (-1); }
	int t = x; int count = 0; int f = x; if (x == 0)printf("0");
	else {
		for (int i = 0; i < 100000000; i++)
			while (x > 0) { x /= 10; count++; }
		for (int i = 0; i < count; i++) {
			if (ooo > 0) {
				if (t < 9) { printf("%d", t); }
				else { f = t % 10; t /= 10; if (f != 0) { printf("%d", f); } }
			}
			else {
				if (i == 0) { printf("%c",'-'); }
				f = t % 10; t /= 10; if (f != 0) {
					printf("%d", f);
				}
			}
		}
	}
		return 0;
}
2023/10/26 18:34
加载中...