用do+while实现1到100
@唐性1837:用do while语句怎么写1+1/2+1/3+1/4+...+1/100 -
龙非18551327085…… main() { float a,b; do { a += 1; b += 1 / a; printf("第%1.f次为:\n %6f\n",a,b); } while (0 < 100 - a); }
@唐性1837:菜鸟求教:用DO WHILE 循环语句编写程序,求1到100之间的所有整数的平方和,并输出结果. -
龙非18551327085…… int sum = 0; int i; for (i=1;i<=100;i++) { sum += i * i; } printf("sum = %d\n", sum);
@唐性1837:1.分别用while语句、do - while语句编写程序,计算e≈1+1/1!+1/2!+...+1/n!. -
龙非18551327085…… double e; int i,k; i=1; k=1; e=1; while(1.0/i*100000<1){ e = e + 1.0/i; k = k + 1; i = i * k; } printf("%f",e);
@唐性1837:输入一个大于1的整数,求1到这个数的阶乘.用do....while语句实现 -
龙非18551327085…… #include <stdio.h> int main() { int num = 0; int result = 1; int i = 2; printf("please input an number greater than 1: "); scanf("%d",&num); //检查输入数字的合法性 while(num <= 1) { printf("input error !\n"); printf("please input an number ...
@唐性1837:c语言用 do while写1/1+1/2+.....+1/20 -
龙非18551327085…… #include void main() { double i=1; double s=0; do { s=s+1.0/i; i++; }while(i printf("%lf\n",s); }
@唐性1837:在c语言中用do while或while求1到10的阶乘之和(初学的) -
龙非18551327085…… #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; }
@唐性1837:利用c语言程序设计来完成 1.用do while循环完成求1~100的累计和. 2.用指针法求数组中的最大值. -
龙非18551327085…… do while实现:int i=1;int s=0;do{s=s+i;i++;}while(0<i<=100)
@唐性1837:c#do while语句实现1到100求和? -
龙非18551327085…… using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { int i = 1; int sum=0; do { sum=i+sum; i++; } while (i<=100); } } }
@唐性1837:vb用do while语句写出1 - 1/2+1/3 - 1/4+...+1/99 - 1/100 -
龙非18551327085…… dim i as integer dim result as double Do While i double = double -(-1)^i *1/n msgbox "The value is : " & double Loop
@唐性1837:输出1到100这100个数(分别用for,while,do - while实现)的java代码 -
龙非18551327085…… 1 public static void main(String[] args){for (int i = 1; i <= 100; i++) { System.out.println(i); }int j=1; while (j<=100) { System.out.println(j); j++; }int k=1; do { System.out.println(k); k++; } while (k<=100); }
龙非18551327085…… main() { float a,b; do { a += 1; b += 1 / a; printf("第%1.f次为:\n %6f\n",a,b); } while (0 < 100 - a); }
@唐性1837:菜鸟求教:用DO WHILE 循环语句编写程序,求1到100之间的所有整数的平方和,并输出结果. -
龙非18551327085…… int sum = 0; int i; for (i=1;i<=100;i++) { sum += i * i; } printf("sum = %d\n", sum);
@唐性1837:1.分别用while语句、do - while语句编写程序,计算e≈1+1/1!+1/2!+...+1/n!. -
龙非18551327085…… double e; int i,k; i=1; k=1; e=1; while(1.0/i*100000<1){ e = e + 1.0/i; k = k + 1; i = i * k; } printf("%f",e);
@唐性1837:输入一个大于1的整数,求1到这个数的阶乘.用do....while语句实现 -
龙非18551327085…… #include <stdio.h> int main() { int num = 0; int result = 1; int i = 2; printf("please input an number greater than 1: "); scanf("%d",&num); //检查输入数字的合法性 while(num <= 1) { printf("input error !\n"); printf("please input an number ...
@唐性1837:c语言用 do while写1/1+1/2+.....+1/20 -
龙非18551327085…… #include void main() { double i=1; double s=0; do { s=s+1.0/i; i++; }while(i printf("%lf\n",s); }
@唐性1837:在c语言中用do while或while求1到10的阶乘之和(初学的) -
龙非18551327085…… #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; }
@唐性1837:利用c语言程序设计来完成 1.用do while循环完成求1~100的累计和. 2.用指针法求数组中的最大值. -
龙非18551327085…… do while实现:int i=1;int s=0;do{s=s+i;i++;}while(0<i<=100)
@唐性1837:c#do while语句实现1到100求和? -
龙非18551327085…… using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { int i = 1; int sum=0; do { sum=i+sum; i++; } while (i<=100); } } }
@唐性1837:vb用do while语句写出1 - 1/2+1/3 - 1/4+...+1/99 - 1/100 -
龙非18551327085…… dim i as integer dim result as double Do While i double = double -(-1)^i *1/n msgbox "The value is : " & double Loop
@唐性1837:输出1到100这100个数(分别用for,while,do - while实现)的java代码 -
龙非18551327085…… 1 public static void main(String[] args){for (int i = 1; i <= 100; i++) { System.out.println(i); }int j=1; while (j<=100) { System.out.println(j); j++; }int k=1; do { System.out.println(k); k++; } while (k<=100); }