这样改就够了#include <stdio.h>int main(){ char sl[100]; int i; for(i=0;scanf("%c",&sl[i]),sl[i]!='!';i++) { if(sl[i]>='a'&&sl[i]<='z') sl[i]-=32; } for(i=0;sl[i]!='!';i++) printf("%c",sl[i]); return 0;}