fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n,P,S;
  6. while(cin >> n){
  7. P = 4*n;
  8. S = n*n;
  9. cout << P << " " << S <<"\n";
  10. }
  11. return 0;
  12. }
Success #stdin #stdout 0s 4480KB
stdin
3
5
10
stdout
12 9
20 25
40 100