admin 管理员组文章数量: 887362
2024年2月28日发(作者:excel中sqrt函数的使用方法)
int main(void){int dmax,dmin,diff,i,r,count;long t;char nums[4],max[4],min[4];srand((unsigned)time(&t));for(count = 0;count <10000;count++){get_random(nums);printf("%c%c%c%cn",nums[0],nums[1],nums[2],nums[3]);for(i=0;i<7;i++){m(nums,4);dmax = nums[0]*1000 + nums[1]*100+nums[2]*10+nums[3];n(nums,4);dmin = nums[0]*1000 + nums[1]*100+nums[2]*10+nums[3];diff = dmax - dmin;diff = j2(diff);if(diff == 6174){printf("find 6174 %dn",count);break;}if(i == 6 && diff != 6174)goto error;nums[0] = diff/1000;nums[1] = diff%1000/100;nums[2] = diff%1000%100/10;nums[3] = diff%10;}}getchar();return (0);error:printf("Can't find 6174 %dn",count);getchar();return (0);}
for(int i=0;i<3;i++){for(int j=i+1;j<4;j++){if(byte[i]int t=byte[i];byte[i] = byte[j];byte[j] = t;}}}// printf(" sort byte is %d %d %d %dn",byte[0],byte[1],byte[2],byte[3]);// printf("<<<<<<<<<<<<<<<
1234the num:1234deal num:1234the max:4321the min:1234the num:3087deal num:3087the max:8730the min:378the num:8352deal num:8352the max:8532the min:2358the num:6174deal num:6174bingoweiqifa@bsp-ubuntu1804:~/c$附图1
版权声明:本文标题:6174C语言编程,C语言验证6174数学问题 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1709082146h537937.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论