結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
![]() |
提出日時 | 2020-07-22 14:56:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 307 bytes |
コンパイル時間 | 515 ms |
コンパイル使用メモリ | 65,004 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-11 20:08:13 |
合計ジャッジ時間 | 1,329 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <iostream> int main(void){ int sum=0; int x; std::string s = "hello world!"; std::cin >> s; const char* c = s.c_str(); for(int i=0;i<s.length();i++){ //std::cout << c[i] <<std::endl; x = (int)(c[i]); if(x>48 && x<58){ sum += (x-48); } } std::cout << sum; }