結果

問題 No.8005 天使のハッシュ関数
ユーザー ldsyb
提出日時 2016-03-21 12:16:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 5 ms / 5,000 ms
コード長 340 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 57,708 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 12:19:16
合計ジャッジ時間 1,250 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘std::string md5sum(const string&)’:
main.cpp:10:10: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |    fscanf(fp,"%s",c);
      |    ~~~~~~^~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;

string md5sum(const string &s){
   string cmd = "echo -n " + s + "| md5sum";
   FILE *fp = popen(cmd.c_str(),"r");
   char c[50];
   fscanf(fp,"%s",c);
   fclose(fp);
   return c;
}

int main(){
   string s;
   cin >> s;
   cout << md5sum(md5sum(s)) << endl;
}
0