用while循环输出1到100
@赫瞿4719:在c语言中用do while或while求1到10的阶乘之和(初学的) -
赏发15367174575…… #include<stdio.h> int main(void) { long result=1; int i=1; while(i<=10) { result*=i; i++; } printf("10的阶乘是:%ld\n",result); return 0; }
@赫瞿4719:用while循环输出1 - 1000之间的水仙花数 -
赏发15367174575…… #include <stdio.h> int main() { int x,sum,count;for(x=101;x<=999;++x) { count=x;sum=0; while(count!=0) { sum+=(count%10)*(count%10)*(count%10); count/=10; }if(sum==x) printf("水仙花数:%d\n",x);} return 0; }
@赫瞿4719:48.编写一个程序,要求用while循环语句,打印1到100的正整数,每行打印5个数,每列右对齐. -
赏发15367174575…… 嗯,确实,右对齐有点麻烦 class Program { static void Main(string[] args) { /*用while循环语句,打印1到100的正整数,每行打印5个数,每列右对齐.*/ int i = 1; while (i <= 100) { if (i % 5 == 0) { if (i < 10) { Console.WriteLine(" "+i.ToString...
@赫瞿4719:用while循环输出1 - 1000之间的水仙花数水仙花数是指一个 n 位数 ( n≥3 ),它的每个位上的数字的 n 次幂之和等于它本身.(例如:1^3 + 5^3 + 3^3 = 153) - 作业帮
赏发15367174575…… [答案] #include int main() { int x,sum,count; for(x=101;x { count=x;sum=0; while(count!=0) { sum+=(count%10)*(count%10)*(count%10); count/=10; } if(sum==x) printf("水仙花数:%d\n",x); } return 0; }
@赫瞿4719:shell脚本用while打印1到10的奇数 -
赏发15367174575…… for((i=1;ido echo $i done
@赫瞿4719:如何使用while 循环输出一个字符串的每个字符 -
赏发15367174575…… 从开头循环到\0, 每个字符单独输出即可. 比如 1 2 3 chars[100]="asjdfh"; inti=0; while(s[i]) putchar(s[i++]);
@赫瞿4719:VB.NET 使用Do While 循环输出1 - 10的阶乘 -
赏发15367174575…… dim i%,jx# i=1 jx=1 do while i<=10 jx=jx*i i=i+1 loop print jx
@赫瞿4719:JAVA中如何用while循环实现一个整数的倒序输出,例如输入12345,输出54321 -
赏发15367174575…… int i = 12343465; int m = 0; while (i != 0) { m =i%10; System.out.print(m); i = i/10; }
@赫瞿4719:从1到10随机选一个数并输出,然后再执行一次,保证与上次的不重复 用Java编写 -
赏发15367174575…… 按照你的要求从1到10随机选一个数并输出,然后再执行一次,保证与上次的不重复的Java程序如下12345678910111213141516 publicclassGG { publicstaticvoidmain(String[] args) { intn=0; intcount=1;//生成的随机数计数 inttmp=(int)(Math....
@赫瞿4719:利用while循环语句输出********* ******* ***** *** * -
赏发15367174575…… int i=0; while(i<5){ int j=9-2*i; while(j>0){ System.out.print("*"); j=j-1; } System.out.print(" "); i=i+1; } 这么简单,相信你自己想十秒就想出来了,为什么还要问呢?
赏发15367174575…… #include<stdio.h> int main(void) { long result=1; int i=1; while(i<=10) { result*=i; i++; } printf("10的阶乘是:%ld\n",result); return 0; }
@赫瞿4719:用while循环输出1 - 1000之间的水仙花数 -
赏发15367174575…… #include <stdio.h> int main() { int x,sum,count;for(x=101;x<=999;++x) { count=x;sum=0; while(count!=0) { sum+=(count%10)*(count%10)*(count%10); count/=10; }if(sum==x) printf("水仙花数:%d\n",x);} return 0; }
@赫瞿4719:48.编写一个程序,要求用while循环语句,打印1到100的正整数,每行打印5个数,每列右对齐. -
赏发15367174575…… 嗯,确实,右对齐有点麻烦 class Program { static void Main(string[] args) { /*用while循环语句,打印1到100的正整数,每行打印5个数,每列右对齐.*/ int i = 1; while (i <= 100) { if (i % 5 == 0) { if (i < 10) { Console.WriteLine(" "+i.ToString...
@赫瞿4719:用while循环输出1 - 1000之间的水仙花数水仙花数是指一个 n 位数 ( n≥3 ),它的每个位上的数字的 n 次幂之和等于它本身.(例如:1^3 + 5^3 + 3^3 = 153) - 作业帮
赏发15367174575…… [答案] #include int main() { int x,sum,count; for(x=101;x { count=x;sum=0; while(count!=0) { sum+=(count%10)*(count%10)*(count%10); count/=10; } if(sum==x) printf("水仙花数:%d\n",x); } return 0; }
@赫瞿4719:shell脚本用while打印1到10的奇数 -
赏发15367174575…… for((i=1;ido echo $i done
@赫瞿4719:如何使用while 循环输出一个字符串的每个字符 -
赏发15367174575…… 从开头循环到\0, 每个字符单独输出即可. 比如 1 2 3 chars[100]="asjdfh"; inti=0; while(s[i]) putchar(s[i++]);
@赫瞿4719:VB.NET 使用Do While 循环输出1 - 10的阶乘 -
赏发15367174575…… dim i%,jx# i=1 jx=1 do while i<=10 jx=jx*i i=i+1 loop print jx
@赫瞿4719:JAVA中如何用while循环实现一个整数的倒序输出,例如输入12345,输出54321 -
赏发15367174575…… int i = 12343465; int m = 0; while (i != 0) { m =i%10; System.out.print(m); i = i/10; }
@赫瞿4719:从1到10随机选一个数并输出,然后再执行一次,保证与上次的不重复 用Java编写 -
赏发15367174575…… 按照你的要求从1到10随机选一个数并输出,然后再执行一次,保证与上次的不重复的Java程序如下12345678910111213141516 publicclassGG { publicstaticvoidmain(String[] args) { intn=0; intcount=1;//生成的随机数计数 inttmp=(int)(Math....
@赫瞿4719:利用while循环语句输出********* ******* ***** *** * -
赏发15367174575…… int i=0; while(i<5){ int j=9-2*i; while(j>0){ System.out.print("*"); j=j-1; } System.out.print(" "); i=i+1; } 这么简单,相信你自己想十秒就想出来了,为什么还要问呢?