#include<stdio.h> void main() { signed char checksum=-1; // int checksum = 0; int ch; // char ch = 0; 初始化,一定要初始化,养成习惯,否则以后肯定吃亏 while((ch=getchar())!=EOF) { putchar(ch); checksum+=ch; } printf("%d\n",checksum); }