結果
問題 |
No.8062 A + B
|
ユーザー |
|
提出日時 | 2020-10-02 01:06:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 466 bytes |
コンパイル時間 | 1,856 ms |
コンパイル使用メモリ | 195,236 KB |
最終ジャッジ日時 | 2025-01-14 23:51:43 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 8 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ string a, b; cin >> a >> b; if(b.front() == '+'){ ll ans = stoll(a); b = b.substr(1); ans += stoll(b); cout << ans << endl; return 0; } if(b.front() == '-'){ ll ans = stoll(a); b = b.substr(1); ans -= stoll(b); cout << ans << endl; return 0; } cout << a + b << endl; return 0; }