fork(3) download
  1. /***
  2.  * FAST C++ I/O for reading int from console
  3.  * @author : safeallah ramezanzadeh
  4.  *
  5.  */
  6. #include <stdio.h>
  7. #include <cstdlib>
  8. using namespace std;
  9.  
  10. int BUF=100000;
  11. int buf_readed;
  12. int buf_index;
  13. char buffer[100000];
  14.  
  15. void my_init(){
  16. buf_index=buf_readed=0;
  17. }
  18. /*****************************************/
  19. char my_getchar(){
  20. char x;
  21. if(buf_index==buf_readed){
  22. buf_index=0;
  23. buf_readed=fread(buffer,1,BUF,stdin);
  24. }
  25. x=buffer[buf_index];
  26. buf_index++;
  27. return x;
  28. }
  29. /*************************************/
  30. int getInt(){
  31. int r=0;
  32. char c;
  33. int sign=1;
  34. while(1){
  35. c=my_getchar();
  36. if(c=='-')
  37. sign=-1;
  38.  
  39. if((c>='0' && c<='9')){
  40. r=(c-'0');
  41. break;
  42. }
  43. }
  44. while(1){
  45. c=my_getchar();
  46. if(!(c>='0' && c<='9'))
  47. break;
  48. r=r*10+(c-'0');
  49. }
  50. return sign*r;
  51. }
  52. /***************************************/
  53. int main(){
  54. my_init();
  55. int t;
  56. t=getInt();
  57. for(int i=0;i<t;i++){
  58. int x;
  59. x=getInt();
  60. printf("%d\n",x);
  61. }
  62. printf("DONE!\n");
  63.  
  64. }
  65.  
Success #stdin #stdout 0s 3512KB
stdin
6
5
123
-57889
0
2
1203330
stdout
5
123
-57889
0
2
1203330
DONE!