10000 add a002 a003 a005 · EarthlyEric/zerojudge@8a037b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a037b2

Browse files
author
EarthlyEric6
committed
add a002 a003 a005
1 parent 1a806ae commit 8a037b2

File tree

6 files changed

+52
-8
lines changed

6 files changed

+52
-8
lines changed

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"files.associations": {
3+
"iostream": "cpp"
4+
},
5+
"C_Cpp.errorSquiggles": "Disabled"
6+
}

a001.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include<iostream>
1+
#include <iostream>
22
using namespace std;
33

44
int main(){

a002.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main(){
5+
int a, b;
6+
cin >> a >> b;
7+
cout << a + b;
8+
}

a003.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main(){
5+
int M;
6+
int D;
7+
while (cin>>M>>D)
8+
{
9+
int S = (M * 2 + D) % 3;
10+
switch (S)
11+
{
12+
case 0:
13+
cout << "普通";
14+
break;
15+
case 1:
16+
cout << "";
17+
break;
18+
case 2:
19+
cout << "大吉";
20+
break;
21+
}
22+
}
23+
}

a004.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <iostream>
22
using namespace std;
3+
34
int main(){
45
int y;
56
while(cin>>y){

a005.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
#include<iostream>
1+
#include <iostream>
22
using namespace std;
33

44
int main(){
5-
int i,x[4];
6-
cin>>i;
7-
for (int r=0;r<+i;r++){
8-
for(int s=0;s<4;s++){
9-
cin>>x[s];
10-
cout<<x[s]<<"";
5+
int i[4];
6+
int time;
7+
cin >> time;
8+
while (time--)
9+
{
10+
cin >> i[0] >> i[1] >> i[2] >> i[3];
11+
if(i[3]-i[2]==i[2]-i[1]){
12+
i[4] = i[3] + (i[3] - i[2]);
13+
}else{
14+
i[4] = (i[1] / i[0]) * i[3];
1115
}
16+
cout << i[0] <<" "<< i[1] <<" " << i[2] <<" " << i[3] <<" " << i[4];
1217
}
18+
1319
}

0 commit comments

Comments
 (0)
0