久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      用c語言求1到1000的同構(gòu)數(shù)

      用c語言求1到1000的同構(gòu)數(shù)

      具體請看實例:

      免費視頻教程推薦:c語言視頻教程

      #include<stdio.h> #include<stdlib.h> #include<string.h> char *right(char *ms,int len); /*截取一個字符串尾部長為len個字符的子串*/ void main() { long a; int len; char as[10]; char ms[20]; printf("求[1,10000]中的同構(gòu)數(shù):n"); for(a=1;a<=10000;a++) { ultoa(a,as,10); /*數(shù)a轉(zhuǎn)換為字符串,存入as*/ len=strlen(as); ultoa(a*a,ms,10); if(strcmp(as,right(ms,len))==0) /*比較字符串a(chǎn)s與ms長為len的子串是否相等*/ printf("%s 其平方為 %sn",as,ms); /*相等就是同構(gòu)數(shù),輸出結(jié)果*/ } system("pause"); } char *right(char *ms,int len) /*截取字符串尾部長為len子串的函數(shù)*/ { int i,j; for(i=0;i<(signed)strlen(ms);ms++); for(j=0;j<len;j++,ms--); return ms; }

      相關(guān)文章教程分享:c語言教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號