1 条题解
-
0
C :
#include <stdio.h> void compute(float a,float b,float *c,float *d); int main(void) { float a,b,c,d; scanf("%f%f",&a,&b); compute(a,b,&c,&d); printf("%g %g",c,d); return 0; } void compute(float a,float b,float *c,float *d) { //c=a+b //d=a-b *c=a+b; *d=a-b; }
C++ :
#include<iostream> #include<cstdio> using namespace std; void comput(float a,float b,float *sum,float *dif) { *sum=a+b; *dif=a-b; } int main() { float a,b,c,d; cin>>a>>b; comput(a,b,&c,&d); printf("%g %g\n",c,d); return 0; }
- 1
信息
- ID
- 1484
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- (无)
- 递交数
- 0
- 已通过
- 0
- 上传者