代码
#include#include using namespace std; void grading(); int atoi(char s[]) { int num = 0; int i = (s[0] == '-' ? 1 : 0); for (; s[i] != ''; i++) { num = num * 10 + (s[i] - '0'); } if (s[0] == '-') num = -num; return num; } int main() { char num1[20] = "-123"; char num2[20] = "456"; cout< 欢迎分享,转载请注明来源:内存溢出
评论列表(0条)