#include <iostream> #include <string> using namespace std; int main() { int x=0,y=0,n; string s,m; while(getline(cin, s,';')){ if(s.length()==3){ if(s[0]=='A'&&isdigit(s[1])&&isdigit(s[2])){ x-=((s[1]-'0')*10+(s[2]-'0'));continue; } ...