Maybe.
Third is:
while (true) { // or while (1)
cin >> a >> b >> c;
if (a == 0 && b == 0 && c ==0) break;
///..... your code
}
.
and next one is:
for (cin >> a >> b >> c; a != 0 /* && b != 0 not necessary*/ && c != 0; cin >> a >> b >> c) {
and of course:
while (cin >> a >> b >> c && a != 0 && c != 0) {
but which one is better?, I don’t know Mybe its only the taste, but:
de quibus non autem gustum