2.编写一个程序,输出10~1000之间的所有素数.要求每行最多打印10个.
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/20 06:12:40
![2.编写一个程序,输出10~1000之间的所有素数.要求每行最多打印10个.](/uploads/image/f/132557-5-7.jpg?t=2.%E7%BC%96%E5%86%99%E4%B8%80%E4%B8%AA%E7%A8%8B%E5%BA%8F%2C%E8%BE%93%E5%87%BA10%7E1000%E4%B9%8B%E9%97%B4%E7%9A%84%E6%89%80%E6%9C%89%E7%B4%A0%E6%95%B0.%E8%A6%81%E6%B1%82%E6%AF%8F%E8%A1%8C%E6%9C%80%E5%A4%9A%E6%89%93%E5%8D%B010%E4%B8%AA.)
privatesubform_click()dimnaslong,snaslongn=inputbox("请输入n")fori=0tonsn=sn+2*i+1nextmsgbox"1+3+5+...(
很简单的二维数组问题先声明一个0-10,0-10的数组然后fori=1to10doforj=1to10doifi=jthena(i,j)=1elsea(i,j)=0应为我不是搞vb的所以只能提供思路就
#includeusingnamespacestd;intmain(void){inta[10][10];inti=0,j=0;for(i=0;i再问:采用VB编写再答:原理一样,列数正着数倒着数和行
1#include"stdio.h"main(){intn,i;scanf("%d",&n);printf("%d",n/100+n%100/10+n%10);system("PAUSE");}2#i
main(){inta=0,i;scanf("%d",&a);for(i=0;i
publicclassTest{publicstaticvoidmain(String[]args){intsum=0;inti=2;while(i
//#include"stdafx.h"//vc++6.0加上这一行.#include"stdio.h"voidmain(void){inti,j,k,sum;for(sum=1,i=0;i
scanf("%d,%d,%d,&a,&b,&c");改成scanf("%d,%d,%d“,&a,&b,&c);printf("thelargerstnumberis%d\n,max");改成prin
classMAXn{publicstaticvoidmain(Stringargs[]){intk=1,sum=0;while((sum+=k)
publicclasstest{publicstaticvoidmain(Stringargs[]){//输出5行for(inti=0;i//输出4列for(intj=1;j//当i==0时输出标题栏
test{publicstaticvoidmain(Stringargs[]){longsum=0,a=1;longi=1;while(i=1)sum=sum+a;i++;a=a*i;}System.
publicclassFactorial{privateintresult=1;publicintfactorial(intnumber){if(number==1)returnresult;else
用C++语言么?那应该很简单for(inti=1;icout
#include "stdio.h"#define ROW 14#define COL 12int main(){ch
#include <stdio.h>void main(){ int i, j;  
programExp1(input,output);varn:longint;beginreadln(n);ifodd(n)thenwriteln(1)elsewriteln(2);end.
#include<stdio.h>int main(){int n,s=0;scanf("%d",&n);while(n){s=
publicclassTest{publicstaticvoidmain(String[]args){ints=0;intn=1;for(inti=0;i
//第1题#include#includeusingnamespacestd;intmain(){inta;cin>>a;cout
//#include"stdafx.h"//vc++6.0加上这一行.#include"stdio.h"voidmain(void){chari,ci,j,n,ch;printf("请输入菱形中心数.