a big problem
AMiR · 2013-05-21 12:24:25
bardiia said:
سلام دوستان ایرانی چگونه ورودی خروجی ها رو باید ست کرددر c++ cin>> cout>> به من جواب بدین
pc2 بعد کسی از دوستان با کار کرده به من اطلاع بده نیاز دارم به کمکش ممنون
I've looked at your code, you have a typo in the definition of the main function. It should be main, not mian ;)
You have to read the input till EOF. You can do so this way:
int a, b;
while (cin >> a >> b) {
cout << a+b << endl;
}
AMiR · 2013-05-21 12:27:29
You can see your compilation error just by clicking on the compilation error in the runs page.
ajibigad · 2013-05-24 08:48:37
i write my codes in c++. i dont know why all my solutions have a runtime of 0ms. does it mean the judge cant read my code.
bardiia · 2013-05-24 10:04:47
سلام ، یه سوال هست از سایت uva فقط میخوام یه روش برای خوندن از ورودی بهم معرفی کنید email:alvadyhamed@gmail.com لینک ترجمه سوال http://acm-problems.blog.ir/1391/03/18/11219-How-old-are-you%3F
AMiR · 2013-05-25 00:27:26
bardiia said:
سلام ، یه سوال هست از سایت uva فقط میخوام یه روش برای خوندن از ورودی بهم معرفی کنید email:alvadyhamed@gmail.com لینک ترجمه سوال http://acm-problems.blog.ir/1391/03/18/11219-How-old-are-you%3F
You can read the input as string, then replace every / character with space, then use stringstream.
ajibigad · 2013-07-02 13:48:53
can someone tell me how this judge works, so i can know how to write my code. do we need to set the given input constriants in our code to?
AMiR · 2013-11-15 01:23:07
ajibigad said:
can someone tell me how this judge works, so i can know how to write my code. do we need to set the given input constriants in our code to?
What do you want to know?
MMBs of IAUT · 2013-12-03 19:18:04
/* * Why this program has runtime error ???!!!!!
import java.util.*; public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
String input;
int [] c = new int [1];
int i=1;
boolean flag = true;
input=inp.nextLine();
String [] A = input.split(" ");
c[0]=Integer.parseInt(A[0])+Integer.parseInt(A[1]);
System.out.println(c[0]);
while (flag){
input=inp.nextLine();
A = input.split(" ");
c=Arrays.copyOf(c, c.length+1);
c[i]=Integer.parseInt(A[0])+Integer.parseInt(A[1]);
System.out.println(c[i]);
i++;
}
}
}
AMiR · 2013-12-03 20:16:13
MMBs of IAUT said:
/* * Why this program has runtime error ???!!!!!
import java.util.*; public class Main {
/** * @param args the command line arguments */ public static void main(String[] args) { Scanner inp = new Scanner(System.in); String input; int [] c = new int [1]; int i=1; boolean flag = true; input=inp.nextLine(); String [] A = input.split(" "); c[0]=Integer.parseInt(A[0])+Integer.parseInt(A[1]); System.out.println(c[0]); while (flag){ input=inp.nextLine(); A = input.split(" "); c=Arrays.copyOf(c, c.length+1); c[i]=Integer.parseInt(A[0])+Integer.parseInt(A[1]); System.out.println(c[i]); i++; } }}
Please open new topic for your problems.
مصطفی · 2014-01-08 08:19:32
باسلام متن سوال The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line. است که با فاصله از هم جدا شده اند یک جفت اعداد صحیح هر خطa,bورودی شامل یک جفت از عددهای صحیح این سوال شر ط خاتمه ندارد یعنی نگفته تا کی این جفت اعداد رابگیرد لطفا کمک کنید باتشکر از سایت خوبتان