sfdgx吧 关注:57贴子:1,458
  • 1回复贴,共1

while → for

只看楼主收藏回复

#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
a=1;
while(a<=10)
{
printf("%d",a);
a++;
}
system("pause");
return 0;
}


IP属地:广东1楼2018-01-15 18:29回复
    #include <stdio.h>
    #include <stdlib.h>
    int main()
    {
    int a;
    for(a=1;a<=10;a++)
    {
    printf("%d ",a);
    }
    system("pause");
    return 0;
    }


    IP属地:广东2楼2018-01-15 18:31
    回复