#include "math.h"main(){int change(int key);int key,s,i;scanf("%d",&key);if(key==0)printf("data error!\n");else{s=change(key);printf("%d\n",s);}i=s%key;printf("%d\n",i);}int change(int key){int i,j=0,s=0; while(key!=0) {i=key%2; key=(int)(key/2); s+=(i*pow(10,j)); j++; } return s;}
如果要用数组的话,可以做出来吗?
楼主,能教我做这道题么!用FOR循环!A BBB CCCCC DDDDDDD EEEEEEEEE FFFFFFFFFFF GGGGGGGGGGGGG我只会用同一个字符做出来!