Submission #00210


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
if(n % 5 == 0 && n % 3 == 0){
cout << "FizzBuzz" << endl;
else if(n%5 == 0){
cout << "Fizz" << endl;
else if(n%3 == 0){
cout << "Buzz" << endl;
else {
cout << n << endl;
}
return 0;
}

ステータス

項目 データ
問題 0013 - FizzBuzz - easy
ユーザー名 ei1827
投稿日時 2019-05-27 18:29:53
言語 C++17
状態 Compile Error
得点 0
ソースコード長 275 Byte
最大実行時間 -
最大メモリ使用量

コンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:1: error: expected ‘}’ before ‘else’
 else if(n%5 == 0){
 ^~~~
./Main.cpp:7:29: note: to match this ‘{’
 if(n % 5 == 0 && n % 3 == 0){
                             ^
./Main.cpp:11:1: error: expected ‘}’ before ‘else’
 else if(n%3 == 0){
 ^~~~
./Main.cpp:9:18: note: to match this ‘{’
 else if(n%5 == 0){
                  ^
./Main.cpp:13:1: error: expected ‘}’ before ‘else’
 else {
 ^~~~
./Main.cpp:11:18: note: to match this ‘{’
 else if(n%3 == 0){
                  ^

セット

セット 得点 Cases

テストケース

ファイル名 状態 実行時間 メモリ使用量 #