結果

問題 No.544 Delete 7
ユーザー ohreitetsu
提出日時 2017-11-07 22:21:20
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 436 bytes
コンパイル時間 454 ms
コンパイル使用メモリ 57,272 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 16:38:57
合計ジャッジ時間 2,106 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
	string s;
	cin>>s;
	string s1=s;
	int i;
	for (i=0;i<s.length();i++){
		if (s[i]=='7'){
			s[i]='6';
		}
		if (s1[i]=='7'){
			s1[i]='1';
		}else{
			s1[i]='0';
		}
	}
	cout<<s<<" ";
	char *p=(char*)s1.c_str();
	while (*p!='\0'){
		if (*p=='0'){
			p++;
			continue;
		}else{
			break;
		}
	}
	if (p){
		cout<<p;
	}
	cout<<endl;
	return 0;
}
0