题目内容

编写程序,输入一个整数,判定该数是否为素数,并输出。#include#include<()>int main(){int x,i,k;printf("请输入一个整数:\n");scanf("%d",&x);k=sqrt(x);for(i=2;();i++)if() break;if()printf("%d是素数",x);elseprintf("%d不是素数",x);return 0;}

查看答案
更多问题

编写一程序,求1-3+5-7+.........-99+101的值。void main(){ int i,s,t=1;for(i=1,();i<=101;()){s+=();t=();}printf(“1-3+5-7+.........-99+101=%d\n",s); }

编写程序求 n!的值。void main( ){ int i,n;long p=1;scanf(( ) ,&n);for(i=1;i<=n;i++)();printf ("1*2*3*……*n=%ld\n",p);}

输入一行字符,分别统计出英文字母、空格、数字和其他字符的个数。#includemain(){int x=0,y=0,z=0,t=0;char a;printf("请输入一行字符:\n");while(()){if((a>='A'&&a<='Z')||(a>='a' &&a<='z'))x++;else if(a==32)y++;else if(())//判定是否为数字z++;elset++;}printf("字母个数为%d,空格个数为%d,数字个数为%d,其他字符为%d\n",());}

[音频][音频]

A. Having no ice-cold lemon juice to ease the crazy heat.
B. Awful job, hot weather and working outside.
C. Having to pay his rent immediately.
D. Graduating from college without his own business.

答案查题题库