fork(109) download
  1. Program Calculette;
  2. Var a, b : Real;
  3. op : Char;
  4. Begin
  5. Readln (a) ;
  6. Readln (op) ;
  7. Readln (b) ;
  8. Case op of
  9. '+' : Writeln (a:3:2,' ',op,' ',b:3:2,' = ',a+b:3:2 ) ;
  10. '-' : Writeln (a:3:2,' ',op,' ',b:3:2,' = ',a-b:3:2) ;
  11. '*' : Writeln (a:3:2,' ',op,' ',b:3:2,' = ',a*b:3:2) ;
  12. '/' : IF b = 0 Then Writeln ('impossible') Else Writeln (a:3:2,' ',op,' ',b:3:2,' = ',a/b:3:2);
  13. Else Writeln ('Opérateur incorrect');
  14. End;
  15. End.
Success #stdin #stdout 0s 288KB
stdin
7
+
6
stdout
7.00 + 6.00 = 13.00