1070 求电压降落值。比较水,就是物理公式。(但是不会啊摔!!!最后还是问了导师这种low low的问题,丢脸( •̀ ω •́ )y阿。)
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
double VS, R, C, w;
int n;
cin >> VS >> R >> C;
cin >> n;
for (int i = 0; i < n; i++){
cin >> w;
double VR = VS*R*C*w / sqrt(C*C*R*R*w*w + 1.0);
cout << setiosflags(ios::fixed) << setprecision(3) << VR << endl;
}
return 0;
}
2001 输入ab 反转求和 再反转。感觉很简单,为什么我用函数就是弄不好?是形参和实参的问题吗?最后直接生猛的多敲了几行代码AC。简单粗暴的女孩。求大神告诉我函数怎么写。
#include<iostream>
using namespace std;
int main(){
int n,a,b;
cin>>n;
while(n--){
cin>>a>>b;
int n1=0,n2=0,n=0;
while(a){
n1=n1*10+a%10;
a=a/10;
}
while(b){
n2=n2*10+b%10;
b=b/10;
}
int c=n1+n2;
while(c){
n=n*10+c%10;
c=c/10;
}
cout<<n<<endl;
}
return 0;
}