結果
問題 | No.544 Delete 7 |
ユーザー |
![]() |
提出日時 | 2018-01-04 19:40:07 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 577 bytes |
コンパイル時間 | 956 ms |
コンパイル使用メモリ | 76,076 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 03:45:05 |
合計ジャッジ時間 | 5,000 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 35 WA * 13 |
ソースコード
#include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <string> #include <sstream> #include <cmath> #include <stack> #include <cctype> using namespace std; int main() { string s; cin>>s; stringstream sstream; sstream<<s; int x=0; sstream>>x; double num=0.0; int s_index=0; while(string::npos != s.find("7")){ s_index = s.find("7"); num += pow(10,s.length()-s_index-1); /* cout<<num<<endl;*/ s.replace(s.find("7"),1,"4"); } if(x<0){ num *=-1; } cout<<s<<" "<<3*num<<endl; /* cout<<3*num<<endl;*/ return 0; }