Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
复数类的加法与减法
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 281, Accepted users: 277
Problem 10499 : No special judgement
Problem description
  定义复数类的加法与减法,使之能够执行下列运算:

     Comples a(2,5),b(7,8),c(0,0);

     c=a+b;

     c=4.1+a;

c=b+5.6;

Input
  输入数据有若干组。每组两行,第一行上有四个数,前两个表示复数a的实部和虚部,后两个表示复数b的实部和虚部。第二行为两个实数mn。第一个实数m为求m+a, 第二个实数n为求b+n

Output
  对于每一组数据,分别输出求和后的结果,格式参照样例输出。 a+b m+a b+n

Sample Input
2 5 7 8
4.1 5.6
1 2 3 4
4.5 6.3
Sample Output
9+(13i)
6.1+(5i)
12.6+(8i)
4+(6i)
5.5+(2i)
9.3+(4i)
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:2347 today,16259074 total, since 2010-05-07