语言入门结束,顺序结构开始

main
YS 5 months ago
parent 460b5ebd2e
commit b73c6fad25

@ -0,0 +1,10 @@
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main()
{
LL a,b;
cin>>a>>b;
cout<<a+b<<endl;
return 0;
}

@ -0,0 +1,9 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
cout<<"Hello,World!";
return 0;
}

@ -0,0 +1,9 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
cout<<b<<endl;
return 0;
}

@ -0,0 +1,12 @@
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main()
{
LL a,b,c;
cin>>a>>b>>c;
printf("%8d %8d %8d",a,b,c);
return 0;
}

@ -0,0 +1,11 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
char ch;
cin>>ch;
cout<<" "<<ch<<endl;
cout<<" "<<ch<<ch<<ch<<endl;
cout<<ch<<ch<<ch<<ch<<ch<<endl;
return 0;
}

@ -0,0 +1,11 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
double a,b,c,d;
cin>>a>>b>>c>>d;
double res = (abs(d-b))/(abs(a-c));
printf("%.2f",res);
return 0;
}
//不会

@ -0,0 +1,10 @@
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main()
{
LL a,b;
cin>>a>>b;
cout<<a+b<<endl;
return 0;
}

@ -0,0 +1,9 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
cout<<(a+b)*c;
return 0;
}

@ -0,0 +1,9 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
cout<<(a+b)/c;
return 0;
}

@ -0,0 +1,9 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a/b<<" "<<a%b<<endl;
return 0;
}

@ -0,0 +1,9 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
double a,b;
cin>>a>>b;
printf("%.9f",a/b);
return 0;
}

@ -0,0 +1,10 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
double a,b;
cin>>a>>b;
printf("%.3f",b/a*100);
cout<<"%";
return 0;
}

@ -0,0 +1,10 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
double F;
cin>>F;
double C = 5*(F-32)/9;
printf("%.5f",C);
return 0;
}

@ -0,0 +1,9 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
double r;
cin>>r;
printf("%.4f %.4f %.4f",2*r,3.14159*r*2,3.14159*r*r);
return 0;
}

@ -0,0 +1,9 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
double r1,r2;
cin>>r1>>r2;
printf("%.2f",(r1*r2)/(r1+r2));
return 0;
}

@ -0,0 +1,10 @@
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main()
{
LL x;
cin>>x;
cout<<x<<endl;
return 0;
}

@ -0,0 +1,9 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
char c;
cin>>c;
cout<<(int) c;
return 0;
}

@ -0,0 +1,9 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
int c;
cin>>c;
cout<<(char)c;
return 0;
}

@ -0,0 +1,11 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x;
cin>>x;
bool flag = (bool)x;
x = (int) flag;
cout<<x<<endl;
return 0;
}

@ -0,0 +1,38 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d,e;
cin>>a>>b>>c>>d>>e;
int cnt = 0;
//第一轮
//a吃掉
cnt += a%3;
a = a / 3;
e += a/3;
b += a/3;
//第二轮
cnt += b%3;
b = b / 3;
a += b/3;
c += b/3;
//第三轮
cnt += c%3;
c = c / 3;
b += c/3;
d += c/3;
//第四轮
cnt += d%3;
d = d / 3;
c += d/3;
e += d/3;
//第五轮
cnt += e%3;
e = e / 3;
d += e/3;
a += e/3;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
cout<<cnt<<endl;
return 0;
}
Loading…
Cancel
Save