两个度给你改完了,自己去比较吧
程序代码:
#include <stdio.h>
int isprime(int n)
{
int i,m;
m=1;
for(i=2;i<n;i++)
if (!(n%i))
{m=0;continue;}
return (m);
}
main()
{
int j,k;
printf("\nplease enter an integer number between 2 and 10000");
scanf("%d",&k);
printf("\nthe prime factor(s) of %d is (are):",k);
for(j=2;j<=k;j++)
if((!(k%j))&&(isprime(j))) printf("\n%4d",j);
printf("\n");
}
程序代码:
#include <stdio.h>
void fun(char *p,char *q,char *c)
{
int k=0;
while(*p||*q)
{
if(*p<*q) c[k]=*q;
else c[k]=*p;
if(*p) p++;
if(*q) q++;
k++;
}
}
main()
{
char a[10]="aBCDeFgh",b[10]="ABcd",c[80]={""};
fun(a,b,c);
printf("the string a:");puts(a);
printf("the string b:");puts(b);
printf("the result:");puts(c);
}