为什么会CE?

P1001 A+B Problem

DreamCHN @ 2023-10-29 22:12:57

CE记录

#include<iostream>
#define int long long
#pragam GCC optimize(2)
using namespace std;
signed main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b;
    return 0;
}

by RBU_PRESIDENT @ 2023-10-29 22:15:10

"prgram"就不对 ,那一行可以删


by liangbowen @ 2023-10-29 22:18:21

洛谷不支持手动开 O2。


by cff_0102 @ 2023-10-29 23:24:46

pragma都打不对


by KOGU @ 2023-11-20 17:00:49

#include<iostream>
using namespace std;
int a,b;
int main(){
    cin>>a>>b;
    cout<<a+b;
    return 0;
}

by acaiji233 @ 2023-11-21 20:20:34

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a,b;
int main(){
    cin>>a>>b;
    cout<<(ll)a+b;
    return 0;
}

不需要pragma


by molin20020531 @ 2023-11-23 16:43:57


by LRRabcd @ 2023-11-25 14:46:22

第三行删掉,就OK了; 代码如下:

#include<iostream>
#define int long long
using namespace std;
signed main(){
  int a,b;
  cin>>a>>b;
  cout<<a+b;
  return 0;
}

by Dream00882 @ 2023-11-25 20:57:01

直接这么写,不行吗?

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    cout<<a+b;
    return 0;
}

by Zhangxinchang_ @ 2023-11-26 11:36:55

@DreamCHN 头文件那么多干吗?

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    cout<<a+b;
    return 0;
}

by conan_24 @ 2023-11-30 21:51:13

#include <iostream>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b;
    return 0;
}

| 下一页