Submission #1604685


Source Code Expand

#include <vector>
#include <algorithm>

using namespace std;

int main(){
	string s;
	int n,i=0,j=0;
	cin >> s >> n;
	while(n>1){
		j++;
		if(j>4){
			i++;
			j=0;
		}
		n--;
	}
	cout << s[i] <<  s[j] << endl;
	
	return 0;
}

Submission Info

Submission Time
Task A - 25個の文字列
User kezawa
Language C++14 (GCC 5.4.1)
Score 0
Code Size 244 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:7:2: error: ‘string’ was not declared in this scope
  string s;
  ^
./Main.cpp:9:2: error: ‘cin’ was not declared in this scope
  cin >> s >> n;
  ^
./Main.cpp:9:9: error: ‘s’ was not declared in this scope
  cin >> s >> n;
         ^
./Main.cpp:18:2: error: ‘cout’ was not declared in this scope
  cout << s[i] <<  s[j] << endl;
  ^
./Main.cpp:18:27: error: ‘endl’ was not declared in this scope
  cout << s[i] <<  s[j] << endl;
                           ^