結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー fura
提出日時 2020-03-18 22:15:35
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 295 bytes
コンパイル時間 2,158 ms
コンパイル使用メモリ 192,420 KB
最終ジャッジ日時 2025-01-09 07:43:24
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:29: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |                 int a; scanf("%d",&a);
      |                        ~~~~~^~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int ans=0;
	rep(i,5){
		int a; scanf("%d",&a);
		if(a%15==0) ans+=8;
		else if(a%3==0) ans+=4;
		else if(a%5==0) ans+=4;
		else ans+=to_string(a).length();
	}
	printf("%d\n",ans);
	return 0;
}
0