Skip to content

Commit

Permalink
feat: added formatting script
Browse files Browse the repository at this point in the history
  • Loading branch information
kweonminsung committed Dec 25, 2023
1 parent 3e4759a commit 8668de7
Show file tree
Hide file tree
Showing 100 changed files with 1,481 additions and 1,296 deletions.
12 changes: 6 additions & 6 deletions 1000/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a, b;
cin >> a >> b;
cout << a + b;
ios::sync_with_stdio(0);
cin.tie(0);

int a, b;
cin >> a >> b;
cout << a + b;
}
12 changes: 6 additions & 6 deletions 10008/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a, b;
cin >> a >> b;
cout << a * b;
ios::sync_with_stdio(0);
cin.tie(0);

int a, b;
cin >> a >> b;
cout << a * b;
}
12 changes: 6 additions & 6 deletions 1001/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a, b;
cin >> a >> b;
cout << a - b;
ios::sync_with_stdio(0);
cin.tie(0);

int a, b;
cin >> a >> b;
cout << a - b;
}
12 changes: 6 additions & 6 deletions 1008/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);
double a, b;
cin >> a >> b;
printf("%.9f", a / b);
ios::sync_with_stdio(0);
cin.tie(0);

double a, b;
cin >> a >> b;
printf("%.9f", a / b);
}
24 changes: 14 additions & 10 deletions 10101/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);

int a, b, c;
cin >> a >> b >> c;
ios::sync_with_stdio(0);
cin.tie(0);

if(a == b && b == c && a == 60) cout << "Equilateral";
else if(a + b + c == 180) {
if(a == b || a == c || b == c) cout << "Isosceles";
else cout << "Scalene";
} else cout << "Error";
int a, b, c;
cin >> a >> b >> c;

if (a == b && b == c && a == 60)
cout << "Equilateral";
else if (a + b + c == 180) {
if (a == b || a == c || b == c)
cout << "Isosceles";
else
cout << "Scalene";
} else
cout << "Error";
}
8 changes: 4 additions & 4 deletions 10171/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using namespace std;

int main() {
cout << "\\ /\\\n";
cout << " ) ( ')\n";
cout << "( / )\n";
cout << " \\(__)|";
cout << "\\ /\\\n";
cout << " ) ( ')\n";
cout << "( / )\n";
cout << " \\(__)|";
}
10 changes: 5 additions & 5 deletions 10172/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using namespace std;

int main() {
cout << "|\\_/|\n";
cout << "|q p| /}\n";
cout << "( 0 )\"\"\"\\\n";
cout << "|\"^\"` |\n";
cout << "||_/=\\\\__|";
cout << "|\\_/|\n";
cout << "|q p| /}\n";
cout << "( 0 )\"\"\"\\\n";
cout << "|\"^\"` |\n";
cout << "||_/=\\\\__|";
}
18 changes: 9 additions & 9 deletions 10430/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);

int a, b, c;
cin >> a >> b >> c;
ios::sync_with_stdio(0);
cin.tie(0);

cout << (a + b) % c << "\n";
cout << ((a % c) + (b % c)) % c << "\n";
cout << (a * b) % c << "\n";
cout << ((a % c) * (b % c)) % c << "\n";
int a, b, c;
cin >> a >> b >> c;

cout << (a + b) % c << "\n";
cout << ((a % c) + (b % c)) % c << "\n";
cout << (a * b) % c << "\n";
cout << ((a % c) * (b % c)) % c << "\n";
}
32 changes: 15 additions & 17 deletions 10773/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@ int k, n, total = 0;
stack<int> S;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);

cin >> k;

while (k--)
{
cin >> n;
if(n == 0) {
total -= S.top();
S.pop();
}
else {
S.push(n);
total += n;
}
ios::sync_with_stdio(0);
cin.tie(0);

cin >> k;

while (k--) {
cin >> n;
if (n == 0) {
total -= S.top();
S.pop();
} else {
S.push(n);
total += n;
}
cout << total;
}
cout << total;
}
31 changes: 17 additions & 14 deletions 10798/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);

char arr[5][20] = {0};
ios::sync_with_stdio(0);
cin.tie(0);

for(int i = 0, j = 0; i < 5; i++) {
j = 0;
string str; cin >> str;
for(char c : str) {
arr[i][j] = c; j++;
}
char arr[5][20] = {0};

for (int i = 0, j = 0; i < 5; i++) {
j = 0;
string str;
cin >> str;
for (char c : str) {
arr[i][j] = c;
j++;
}
}

for(int i = 0; i < 20; i++) {
for(int j = 0; j < 5; j++) {
if(arr[j][i]) cout << arr[j][i];
}
for (int i = 0; i < 20; i++) {
for (int j = 0; j < 5; j++) {
if (arr[j][i])
cout << arr[j][i];
}
}
}
33 changes: 17 additions & 16 deletions 10807/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);

int n, v, total = 0;
int arr[100];
cin >> n;
ios::sync_with_stdio(0);
cin.tie(0);

for(int i = 0; i < n; i++) {
int k;
cin >> k;
arr[i] = k;
}
cin >> v;
int n, v, total = 0;
int arr[100];
cin >> n;

for(int i = 0; i < n; i++) {
if(arr[i] == v) total++;
}
for (int i = 0; i < n; i++) {
int k;
cin >> k;
arr[i] = k;
}
cin >> v;

cout << total;
for (int i = 0; i < n; i++) {
if (arr[i] == v)
total++;
}

cout << total;
}
20 changes: 10 additions & 10 deletions 10808/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);

string s;
cin >> s;
ios::sync_with_stdio(0);
cin.tie(0);

int arr[26] = {};
string s;
cin >> s;

for(auto c : s)
arr[c - 'a']++;
int arr[26] = {};

for(char i = 0; i < 26; i++)
cout << arr[i] << " ";
for (auto c : s)
arr[c - 'a']++;

for (char i = 0; i < 26; i++)
cout << arr[i] << " ";
}
31 changes: 16 additions & 15 deletions 10810/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);

int n, m;
int arr[100] = {0, };
ios::sync_with_stdio(0);
cin.tie(0);

cin >> n >> m;
int n, m;
int arr[100] = {
0,
};

while(m--) {
int i, j, k;
cin >> i >> j >> k;
for(int a = i; a <= j; a++) {
arr[a - 1] = k;
}
}
cin >> n >> m;

for(int i = 0; i < n; i++) {
cout << arr[i] << " ";
while (m--) {
int i, j, k;
cin >> i >> j >> k;
for (int a = i; a <= j; a++) {
arr[a - 1] = k;
}
}

for (int i = 0; i < n; i++) {
cout << arr[i] << " ";
}
}
38 changes: 20 additions & 18 deletions 10811/main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);

int n, m;
int arr[100] = {0, };
ios::sync_with_stdio(0);
cin.tie(0);

cin >> n >> m;
int n, m;
int arr[100] = {
0,
};

for(int i = 0; i < n; i++) {
arr[i] = i + 1;
}
cin >> n >> m;

while(m--) {
int i, j;
cin >> i >> j;
for(int a = i - 1; a < (i + j) / 2; a++) {
swap(arr[a], arr[j + i - a - 2]);
}
}
for (int i = 0; i < n; i++) {
arr[i] = i + 1;
}

for(int i = 0; i < n; i++) {
cout << arr[i] << " ";
while (m--) {
int i, j;
cin >> i >> j;
for (int a = i - 1; a < (i + j) / 2; a++) {
swap(arr[a], arr[j + i - a - 2]);
}
}

for (int i = 0; i < n; i++) {
cout << arr[i] << " ";
}
}
Loading

0 comments on commit 8668de7

Please sign in to comment.