把while (a!='q');改成while (1);。
把cin >> a;cin >> b;cin >> c;三行改成if(!(cin >> a >> b >> c)) break;。
您好,你定义的int a,a是整形,你输入字母,类型不同a不能存放字母