代码资料:
#include "stdio.h"
int main(int argc,char *argv[]){
int s,i;
char ch;
printf("Please enter 3 letters...\n");
for(s=i=0;i<3;i++){
scanf(" %c",&ch);
if(ch>='a' && ch<='z' || ch>='A' && ch<='Z')
s+=ch;
else{
printf("Input error, redo: \n");
fflush(stdin);
i--;
}
}
printf("The sum of the ASCII is %d\n",s);
return 0;
}