top1编程
← 返回题目
题解

【入门】循环输出1~100之间的每个数

3 条题解

  • 0
    @ 2026-7-29 20:24:03
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	for (int i = 1; i <= 100; i++) {
    		cout << i << endl;
    	}
    	return 0;	
    }
    
    • 0
      @ 2026-7-29 0:06:25
      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	for (int i = 1; i <= 100; i++) {
      		cout << i << endl;
      	}
      	return 0;	
      }
      
      • 0
        @ 2026-7-28 22:10:00
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
        	int i=1;
        	while(i<=100){
        		cout<<i<<endl;
        		i++;
        	}
        	return 0;
        }
        
        • 1