top1编程
← 返回题目
题解

【入门】中间值

1 条题解

  • 0
    @ 2026-7-29 0:15:39
    #include <bits/stdc++.h>
    using namespace std;
    int main(){
    	int n;
    	cin >> n;
    	if(n%2==1){
    		cout << (n+1)/2;
    	}else{
    		cout << n+1;
    	}
    	return 0; 
    }
    
    • 1