#include <iostream> using namespace std; int main( ) { int i,a,b,c,d; a=b=c=d=0; do { cin>>i; switch (i) { case 0: case 1: case 2: case 3: case 4: d++; break; case 5: case 6: c++; break; case 7: case 8: b++; break; case 9: case 10: a++; break; } } while (i<=10); cout<<"A:"<<a<<endl; cout<<"B:"<<b<<endl; cout<<"C:"<<c<<endl; cout<<"D:"<<d<<endl; return 0; }
时间: 2024-10-17 10:48:01