文章
61
粉丝
137
获赞
18
访问
38.3k
#include<bits/stdc++.h>
using namespace std;
void add(double xa, double xb, double ya, double yb){
double a = xa + ya;
double b = xb + yb;
printf("%.1f %.1f\n", a, b);
}
void mutiply(double xa, double xb, double ya, double yb){
double a = xa*ya - xb*yb;
double b = xa*yb + ya*xb;
printf("%.1f %.1f\n", a, b);
}
int main(){
double xa, xb;
double ya, yb;
char op;
cin >> xa >> xb >> ya >> yb;
cin >> op;
if(op == '+')
add(xa, xb, ya, yb);
else if(op == '*')
mutiply(xa, xb, ya, yb);
return 0;
}
登录后发布评论
暂无评论,来抢沙发