結果
問題 |
No.544 Delete 7
|
ユーザー |
![]() |
提出日時 | 2017-07-15 16:20:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 620 bytes |
コンパイル時間 | 652 ms |
コンパイル使用メモリ | 61,084 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-08 02:28:24 |
合計ジャッジ時間 | 2,676 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 11 WA * 37 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:28:11: warning: ‘a’ may be used uninitialized in this function [-Wmaybe-uninitialized] 28 | a += pow(10,ans[i]); | ~~^~~~~~~~~~~~~~~~~
ソースコード
#include <iostream> #include <string> #include <cmath> #define MAX 1000000000 using namespace std; bool check(long long x){ string s = to_string(x); for(int i=0; i<s.length(); i++){ if(s[i] == '7'){ return false; } } return true; } int main(void){ long long n, a, b; int ans[1000],cnt=0; cin >> n; string s = to_string(n); for(int i=0; i<s.length(); i++){ if(s[i] == '7'){ ans[cnt++] = i; } } for(int i=0;i<cnt;i++){ a += pow(10,ans[i]); } b = n - a; cout << a << " " << b << endl; return 0; }