# Include <stdio. h> # include <stdlib. h> # include <string. h> # include <ctype. h> int main () {float P, U, I; char s [300]; char temp [100]; int N, Count = 0, K, I, J; scanf ("% d", & N); getchar (); While (n --) {P = u = I = 0; gets (s ); printf ("problem # % d \ n", ++ count); for (I = 0; I <strlen (s); I ++) {If (s [I] = ') {k = 0; Switch (s [I-1]) {case 'p': For (j = I + 1 ;! Isalpha (s [J]); j ++) temp [k ++] = s [J]; temp [k] = '\ 0 '; P = atof (temp); If (s [J] = 'M') p * = 0.001; If (s [J] = 'k') p * = 1000; if (s [J] = 'M') p * = 1000000; break; Case 'U': For (j = I + 1 ;! Isalpha (s [J]); j ++) temp [k ++] = s [J]; temp [k] = '\ 0 '; U = atof (temp); If (s [J] = 'M') u * = 0.001; If (s [J] = 'k') u * = 1000; if (s [J] = 'M') u * = 1000000; break; Case 'I': For (j = I + 1 ;! Isalpha (s [J]); j ++) temp [k ++] = s [J]; temp [k] = '\ 0 '; I = atof (temp); If (s [J] = 'M') I * = 0.001; If (s [J] = 'k') I * = 1000; if (s [J] = 'M') I * = 1000000; break ;}} if (P = 0) printf ("P = %. 2lfw \ n ", 1.0 * u * I); If (u = 0) printf (" u = %. 2 LFV \ n ", 1.0 * P/I); if (I = 0) printf (" I = %. 2lfa \ n ", 1.0 * P/U);} return 0 ;}