fork(1) download
  1. #include <iostream>
  2. #include <map>
  3. #include <utility>
  4. #include <string>
  5. using namespace std;
  6.  
  7. string f (int a, int b, int c, int d) {
  8. using input = tuple<int,int,int,int>;
  9.  
  10. static map<input,string> mytable = {
  11. { input{ 1, 3, 0, 1 }, "ok"},
  12. { input{ 0, 2, 1, 2 }, "fault"},
  13. { input{ 0, 0, 0, 0 }, "warning"}
  14. };
  15.  
  16. return mytable[input{a,b,c,d}];
  17. }
  18.  
  19. int main() {
  20. // your code goes here
  21. cout << f(0,2,1,2) <<endl;
  22. return 0;
  23. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
fault