fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. NP = 5
  6. for i in range(NP):
  7. name
  8. scanf("%s",name); //name is a variable which holds the current name
  9.  
  10. giver_an = search(name); // search that current name to find its array index and giver_an will store that
  11. scanf("%d %d",&im,&np);
  12.  
  13. /* im and np will store the initial amount of money and the number of pe ople whom will be given gifts, respectively.
  14. I think I don't need to describe the rest, you can easily understand.*/
  15. account[giver_an] -= im;
  16. if(np!=0)
  17. account[giver_an] += im % np;
  18.  
  19. for(j=0; j<np; j++){
  20. scanf("%s",name);
  21. taker_an = search(name);
  22. account[taker_an] += im/np;
  23. }
  24.  
  25. }
  26. return 0;
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
dave 200 3 laura owen vick
owen 500 1 dave
amr 150 2 vick owen
laura 0 2 amr vick
vick 0 0
compilation info
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/py_compile.py", line 117, in compile
    raise py_exc
py_compile.PyCompileError:   File "prog.py", line 2
    using namespace std;
                  ^
SyntaxError: invalid syntax

stdout
Standard output is empty