70分c++求助
查看原帖
70分c++求助
1011497
The_fisher楼主2023/8/13 13:12

本蒟蒻70分

大佬们,帮蒟蒻看看吧

#include <bits/stdc++.h>

using namespace std;

char str[11];
bool un = false;

main() {
	gets(str);
	if (str[0] == '-') {
		un = true;
	}
	int len = strlen(str);
	if (un) {
		cout << "-";
	}
	while (len--) {
		if (str[len] == '0' || str[len] == '-') {
			continue;
		}
		cout << str[len];
	}
}
2023/8/13 13:12
加载中...