1 solutions
-
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
Information
- ID
- 19671
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- (None)
- # Submissions
- 0
- Accepted
- 0
- Uploaded By