// HJ1 字符串最后一个单词的长度.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include<iostream> #include<bits/stdc++.h> using namespace std; int main() { string s; while (getline(cin, s)) { reverse(s.begin(), s.end());//反转字符串 int a=count(s.begin(), s.end(), ' ');//查找空格数量 if (a == 0)//判断是否有空格 { ...