Commit 8f69997b by 李楚霏

work07

parent 555f686f
#include<iostream>
using namespace std;
double sum(int n1, int n2) {
return (double) (2.0 * n1 * n2 /(n1+ n2));
}
int main() {
int n1, n2;
while ((cin>>n1>>n2))
{
/* code */
if (n1 ==0 || n2 ==0 ) break;
cout<<"sum:"<< sum(n1, n2)<<endl;
}
return 0;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment