[ create a new paste ] login | about

Link: http://codepad.org/IR0iaaRc    [ raw code | output | fork ]

C++, pasted on Feb 18:
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
	char a[30];
	cin.getline(a, 30);
	int i = strlen(a);
	while (a[i] != ' ')
	{
		i--;
	}
	for (int j = i+1;j < strlen(a);j++)
	{
		cout << a[j];
	}
	cout << endl;
	for (int j = 0;j < i;j++)
	{
		cout << a[j];
	}
	return 0;
}


Output:
1
2
3
cc1plus: warnings being treated as errors
In function 'int main()':
Line 13: warning: comparison between signed and unsigned integer expressions


Create a new paste based on this one


Comments: