1.最短代码
#include <iostream>
int main() {
int a,b;
std::cin>>a>>b;
std::cout<<a+b;
}
别学我不return 0;
2.正常
#include <iostream>
using namespace std;
int main() {
//ios::sync_with_stdio(false);
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
return 0;
}
3.C#来一个!
#include <stdio.h>
using namespace std;
int main(void) {
int a,b;
scanf("%d%d",&a,&b);
printf("%d%d",a+b);
return 0;
}
4.函数
#include <bits/stdc++.h>
using namespace std;
int jia(int a, int b) {
return a + b;
}
int main() {
int a, b;
cin >> a >> b;
cout << jia(a, b);
return 0;
}
5.油饼
#include <bits/stdc++.h>
using namespace std;
int a, b, ans;
void input();
void doit();
void output();
int main() {
input();
doit();
output();
return 0;
}
void input() {
cin >> a >> b;
}
void doit() {
ans = a + b;
}
void output() {
cout << ans;
}
大家有新思路也可以评论区告诉我!