exemplo_2_imprimir_quadrado_solucao.ivph 2.7 KB

12345678910111213141516171819202122232425262728293031
  1. {
  2. "testcases" : [
  3. {
  4. "input": ["2"],
  5. "output": ["4"]
  6. },
  7. {
  8. "input": ["1"],
  9. "output": ["1"]
  10. },
  11. {
  12. "input": ["3"],
  13. "output": ["9"]
  14. },
  15. {
  16. "input": ["10"],
  17. "output": ["100"]
  18. },
  19. {
  20. "input": ["20"],
  21. "output": ["400"]
  22. }
  23. ] ,
  24. "settings_data_types":
  25. [{"name":"integer_data_type","value":"on"},{"name":"real_data_type","value":"on"},{"name":"text_data_type","value":"on"},{"name":"boolean_data_type","value":"on"},{"name":"void_data_type","value":"on"}],
  26. "settings_commands":
  27. [{"name":"commands_read","value":"on"},{"name":"commands_write","value":"on"},{"name":"commands_comment","value":"on"},{"name":"commands_attribution","value":"on"},{"name":"commands_functioncall","value":"on"},{"name":"commands_iftrue","value":"on"},{"name":"commands_repeatNtimes","value":"on"},{"name":"commands_while","value":"on"},{"name":"commands_dowhile","value":"on"},{"name":"commands_switch","value":"on"}],
  28. "settings_functions":
  29. [{"name":"functions_creation","value":"on"},{"name":"functions_move","value":"on"}] }
  30. ::algorithm::
  31. {"functions":[{"type":"function","name":"inicio","return_type":"void","return_dimensions":0,"parameters_list":[],"is_main":true,"is_hidden":false,"variables_list":[{"type":"integer","name":"valor","value":1,"dimensions":0,"is_constant":false,"rows":0,"columns":0},{"type":"integer","name":"quadrado","value":1,"dimensions":0,"is_constant":false,"rows":0,"columns":0}],"function_comment":{"type":"comment","comment_text":"This is the main function..."},"commands":[{"type":"reader","variable_value_menu":{"type":"var_value","variable_and_value":1,"content":{"type":"integer","name":"valor","value":1,"dimensions":0,"is_constant":false,"rows":0,"columns":0},"row":null,"column":null,"include_constant":false}},{"type":"attribution","variable":{"type":"var_value","variable_and_value":1,"content":{"type":"integer","name":"quadrado","value":1,"dimensions":0,"is_constant":false,"rows":0,"columns":0},"row":null,"column":null,"include_constant":false},"expression":[{"type_exp":"op_exp","itens":["none",{"type_exp":"exp_op_exp","itens":[{"type":"var_value","variable_and_value":7,"content":{"type":"integer","name":"valor","value":1,"dimensions":0,"is_constant":false,"rows":0,"columns":0},"row":null,"column":null,"include_constant":true},"multiplication",{"type":"var_value","variable_and_value":7,"content":{"type":"integer","name":"valor","value":1,"dimensions":0,"is_constant":false,"rows":0,"columns":0},"row":null,"column":null,"include_constant":true}]}]}]},{"type":"writer","content":[{"type":"var_value","variable_and_value":7,"content":{"type":"integer","name":"quadrado","value":1,"dimensions":0,"is_constant":false,"rows":0,"columns":0},"row":null,"column":null,"include_constant":true}]}]}],"globals":[]}