c語言問題迴文數!!急,拜託高人指點

2021-07-30 12:58:22 字數 1455 閱讀 8896

1樓:

新增上滿足你補充要求的c程式:

#include

int palindrome(unsigned int x)if(s==x)

return 1;

else

return 0;

} void main() }

}執行結果如下:

符合條件的n為:12

3112226

101111

121press any key to continue已經上機驗證過了!!!

#include

#include

#include

int palindrome(unsigned int x) //if(s==x)

return 1;

else

return 0;

} void reverse(unsigned char *buf,int size)

int i=1,itmp;//

while(x<2147483647)//2147483647)itoa(x,strt,10);

reverse((unsigned char*)strt,i);

temp=atoi(strt);

x+=temp;

if(palindrome(x))

}cout<<"沒有算出迴文數!\n";}

2樓:匿名使用者

#include

main()

while (s>0);

s = s0;

for (i=1;i<=n;i++)

printf("%d\n",b);}

3樓:林寒凌

應該是ok的,是標準答案

求教大神c語言迴文數程式設計,急!!!!

4樓:匿名使用者

#include

#include

void main()

int j=0,k=0,b=0;

for(j;j

程式很亂的,也看出你的題目要求是啥。

c語言 求1000-9999的迴文數 急! 20

5樓:弒之觴

#include

main(void)

return 0;}

如何找到迴文數,c語言如何求迴文數

第一步,把1000 10000之間的迴文數找出來 1001 1111 1221 1331 1441 1551 1661 1771 1881 1991 2002 2112 2222 2332 2442 2552 2662 2772 2882 2992 第二步,因為是6的倍數,所以首先必須是2的倍數,即...

C語言遞迴的問題高分求高人指點

問題一 這時的程式是直接返回 不滿足條件時再執行 問題二 這裡應該轉換為字元的輸出格式,因為n 10得出的結果是一個整型,不是字元型。這遞迴函式目的是為了得到一個數的最高位,比如 1234這個數,除以10後得到123,條件滿足,則遞迴回去再除以10得到12,條件還滿足,則再遞迴再除以10,這時條件就...

急c語言問題,C語言問題急急急!!!!

改了,可以用vc 6.0編譯,問題不多,就是有些地方不注意。include include define c 30 3.1415926 180 define a 2.8 define d 7 define h 4 define p 90 define q 70 int hanshu1 nm int ...