啊哈磊_编程从这里起步

标题: 1~100不用for怎么写 [打印本页]

作者: 光阴似箭    时间: 2019-7-9 11:25
标题: 1~100不用for怎么写
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4. {
  5.     int a b
  6.     a=1;
  7.     b=2;
  8.     while(b<200)
  9.     {
  10.         b=b+2;
  11.         a=a+1+a;
  12.         printf("%d",a);
  13.     }
  14.    
  15.     return 0;
  16. }
复制代码

作者: Austin    时间: 2019-7-12 22:33
#include <stdio.h>
#include <stdlib.h>
int main()
{
       int a=1;
       while(a<=100)
       {     
             printf(“%d”,a);
             a++;
       }
       return 0;
}





欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/) Powered by Discuz! X3.2