how to make a BufferedReader in C
Posted
by peiska
on Stack Overflow
See other posts from Stack Overflow
or by peiska
Published on 2010-06-03T17:28:28Z
Indexed on
2010/06/03
17:34 UTC
Read the original article
Hit count: 216
I am really new programming in C. How can i do the same in C, maybe in a more simple way then the one a do in Java. Each line of the input have to Integers: X e Y separated by a space.
12 1
12 3
23 4
9 3
InputStreamReader in = new InputStreamReader(System.in);
BufferedReader buf = new BufferedReader(in);
int n;
int k;
double sol;
String line ="";
line=buf.readLine();
while( line != null && !line.equals("")){
String data [] = line.split(" ");
n = Integer.parseInt(data[0]);
k = Integer.parseInt(data[1]);
calculus (n,k);
line = buf.readLine();
}
© Stack Overflow or respective owner