結果
| 問題 |
No.544 Delete 7
|
| コンテスト | |
| ユーザー |
newlife171128
|
| 提出日時 | 2018-01-04 19:52:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 584 bytes |
| コンパイル時間 | 609 ms |
| コンパイル使用メモリ | 76,664 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 16:40:32 |
| 合計ジャッジ時間 | 2,512 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 48 |
ソースコード
#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.0,s.length()-s_index-1);
/* cout<<num<<endl;*/
s.replace(s.find("7"),1,"4");
}
if(x<0){
num *=-1;
}
cout<<s<<" "<<3*(int)num<<endl;
/* cout<<3*num<<endl;*/
return 0;
}
newlife171128