标签:scan pre for str return string scanf ring int
#include <stdio.h> #include <string.h> int main() { char mz[]="ZHongGuo"; int zmb[26]; int i,n; for(i=0;i<26;++i){ zmb[i]=0; } i=0; while(mz[i] != ‘\0‘){ if(mz[i]>=‘a‘ && mz[i]<=‘z‘) n=mz[i]-‘a‘; else n=mz[i]-‘A‘; ++zmb[n]; ++i; } printf("name: %s\n",mz); for(i=0;i<26;++i){ if(zmb[i] != 0){ printf("%c or %c: %d\n",i+‘A‘,i+‘a‘,zmb[i]); } } return 0; }
#include <stdio.h> int main() { int n,i; scanf("%d",&n); int v[n]; for(i=n-1;i>=0;--i){ scanf("%d",&v[i]); } for(i=0;i<n;++i){ printf("%4d ",v[i]); } return 0; }
标签:scan pre for str return string scanf ring int
原文地址:http://www.cnblogs.com/linhao8/p/6053783.html