题解「LYHOI R2」A+B+C Problem(U538998)

· · 个人记录

思路

输入三个数,输出它们的和。
不需要开 long long,用 int 就可以了。

代码

#include<bits/stdc++.h>
using namespace std;
int a,b,c;//定义a,b,c
int main(){
    cin>>a>>b>>c;//输入a,b,c
    cout<<a+b+c;//输出a,b,c的和
    return 0;
}

时间复杂度分析

该代码的时间复杂度为 O(1),不会超过 1000 \text{ ms} 的时限。