ijumps / hustoj

Automatically exported from code.google.com/p/hustoj
1 stars 0 forks source link

How can I "#include <iostream>" only to use "scanf()" and "printf()" in c++ ? #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There will be a compile error if I "#include <iostream>" only and use "scanf()" 
and "printf()" function in c++ . 
This is not an error , but I want to make it work . What should I do ? 

Thank you ! 

Original issue reported on code.google.com by vastwelk...@gmail.com on 14 Jul 2010 at 4:12

GoogleCodeExporter commented 9 years ago
This problem is dependent to compiler in server system, so it's not a hustoj's 
problem.

In GNU C++ version 4, iostream header doesn't include cstdio's I/O fucntion.

Change the G++ compiler if you want to work( maybe GNU C++ version 3 iostream 
header includes cstdio's I/O function).

Original comment by method4libe on 14 Jul 2010 at 5:36

GoogleCodeExporter commented 9 years ago
try modify your <iostream> ,add "#include <stdio.h>" at the top of file

Original comment by newsc...@gmail.com on 24 Jul 2010 at 3:23

GoogleCodeExporter commented 9 years ago
The best way should be using GCC3 instead of GCC4 . 

Original comment by vastwelk...@gmail.com on 24 Jul 2010 at 8:08