#include<iostream> using namespace std; int findLastNumLength(char *s,int le) { if(s==NULL||le<=0) return 0; int l=0; char *endl=s; while(*endl) endl++; endl--; while(*endl==' ') endl--; while(le) { if(*endl!=' ') { l++; endl--; } le--; } return l; } int main() { char s[100]; cin.getline(s,100); cout<<findLastNumLength(s,strlen(s)); system("pause"); return 0; }