Загрузка данных


#include <iostream>
using namespace std;
#include <string>
int main()
{
	string st, st2;
	// количество пробелов в строке
	int count = 0;
	//ввод строки с пробелами
	getline(cin, st);
	// посимвольный перебор строки и сравнение с пробелами
	for (auto s : st) {
		if (s == ' ') {
			count++;
		}
		st2 = s + st2;
	}
	cout << count + 1;
	if (st == st2) {
		cout << 'da';
	}
	else {
		cout << "no";
	}
}