Submission #9699

# Submission time Handle Problem Language Result Execution time Memory
9699 2014-09-28T08:10:13 Z carl111 Veni, vidi, vici (kriii2_V) C++14
Compilation error
0 ms 0 KB
#include <stdio.h>
#include <string>

using namespace std;

int main()
{
	int N;
	scanf("%d",&N);
	char buf[200];
	while(scanf("%s",buf)!=-1)
	{
		string str = buf;
		string res = "";

		if(str.length()%2 == 1)
		{
			str.pop_back();
		}

		while(!str.empty())
		{
			char y = str[0] - 'a';
			char z = str[1] - 'a';
			str = str.substr(2);

			char x ='a'+ (26+y+z-N)%26;

			res.push_back(x);
		}
		printf("%s ",res.c_str());
	}
	return 0;
}

Compilation message

V.cpp: In function 'int main()':
V.cpp:18:8: error: 'std::string' has no member named 'pop_back'
V.cpp:9:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]