top1编程
← 返回题目
题解

【入门】明明的步行

1 条题解

  • 0
    @ 2026-7-29 0:19:30
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n;
    	cin>>n;
    	int sum=0;
    	while(n!=0){
    		sum+=n;
    		n--;
    		//TODO
    	}
    	cout<<sum;
        return 0;
    }
    
    • 1