Submission #5778319


Source Code Expand

include<bits/stdc++.h>
using namespace std;
int a[7]={0,1,2,3,4,5,6},n;
int main()
{cin>>n;
n%=30;
 for(int i=0;i<n;i++) swap(a[i%5+1],a[i%5+2]);
 for(int i=1;i<=6;i++) cout<<a[i]<<endl;;
 return 0;
}

Submission Info

Submission Time
Task C - 入れ替え
User luogu_bot2
Language C++ (GCC 5.4.1)
Score 0
Code Size 209 Byte
Status CE

Compile Error

./Main.cpp:1:1: error: ‘include’ does not name a type
 include<bits/stdc++.h>
 ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:5:2: error: ‘cin’ was not declared in this scope
 {cin>>n;
  ^
./Main.cpp:7:45: error: ‘swap’ was not declared in this scope
  for(int i=0;i<n;i++) swap(a[i%5+1],a[i%5+2]);
                                             ^
./Main.cpp:8:24: error: ‘cout’ was not declared in this scope
  for(int i=1;i<=6;i++) cout<<a[i]<<endl;;
                        ^
./Main.cpp:8:36: error: ‘endl’ was not declared in this scope
  for(int i=1;i<=6;i++) cout<<a[i]<<endl;;
                                    ^