判断的依据是 空格' '字符 #include "stdio.h"#include "conio.h"#include "string.h"int count_words(char str[]);void main(){ int n; char s[80]; clrscr(); printf("Input a string:"); gets(s); n=count_words(s); ... Read More
从键盘输入一个正整数,判断其是否为回文数。所谓回文数是顺读和反读都一样的数,如12321,23455432都是回文数。 #include "Stdio.h"#include "Conio.h"int main(void){ int i,k; long n,m; int digit[10]; clrscr(); puts("Please input a long number:"); s... Read More
#include #include #define N 10void yanghui(int a[][N],int n);void main(){ int i,j,n,b[N][N]; printf("Enter n:"); scanf("%d",&n); yanghui(b,n); for(i=0;i<n;i++) { for(j=0;j<=i;j++) pr... Read More