buggy_code
stringlengths 11
625k
| fixed_code
stringlengths 17
625k
| bug_type
stringlengths 2
4.45k
| language
int64 0
8
| token_count
int64 5
200k
|
|---|---|---|---|---|
#include <stdio.h>
#define N 5
int main(void) {
int a[N], tmp;
for (int i = 0; i < N; i++)
scanf("%d", &a[i]);
for (int i = N - 1; i > 0; i--) {
for (int j = 0; j < i; j++) {
if (a[j] > a[j + 1]) {
tmp = a[j];
a[j] = a[j + 1];
a[j + 1] = tmp;
}
}
}
for (int i = 0; i < N - 1; i++)
printf("%d ", a[i]);
printf("%d\n", a[N - 1]);
return 0;
}
|
#include <stdio.h>
#define N 5
int main(void) {
int a[N], tmp;
for (int i = 0; i < N; i++)
scanf("%d", &a[i]);
for (int i = N - 1; i > 0; i--) {
for (int j = 0; j < i; j++) {
if (a[j] < a[j + 1]) {
tmp = a[j];
a[j] = a[j + 1];
a[j + 1] = tmp;
}
}
}
for (int i = 0; i < N - 1; i++)
printf("%d ", a[i]);
printf("%d\n", a[N - 1]);
return 0;
}
|
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
| 1
| 171
|
#include <bits/stdc++.h>
#include <stdint.h>
typedef uint32_t u32;
typedef uint64_t u64;
int main() {
u64 a[5];
for (u32 i = 0; i < 5; ++i) {
std::cin >> a[i];
}
std::sort(a, a + 5);
std::reverse(a, a + 5);
std::cout << a[0];
for (int i = 1; i < 5; ++i) {
std::cout << " " << a[i];
}
std::cout << std::endl;
return 0;
}
|
#include <bits/stdc++.h>
#include <stdint.h>
typedef uint32_t u32;
typedef uint64_t u64;
int main() {
int a[5];
for (u32 i = 0; i < 5; ++i) {
std::cin >> a[i];
}
std::sort(a, a + 5);
std::reverse(a, a + 5);
std::cout << a[0];
for (int i = 1; i < 5; ++i) {
std::cout << " " << a[i];
}
std::cout << std::endl;
return 0;
}
|
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
| 1
| 120
|
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int num[5];
for (int i = 0; i < 5; i++) {
cin >> num[i];
}
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
if (num[i] <= num[j]) {
swap(num[i], num[j]);
}
}
}
cout << num[0];
for (int i = 1; i < 5; i++) {
cout << " " << num[i];
}
cout << endl;
return (0);
}
|
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int num[5];
for (int i = 0; i < 5; i++) {
cin >> num[i];
}
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
if (num[i] >= num[j]) {
swap(num[i], num[j]);
}
}
}
cout << num[0];
for (int i = 1; i < 5; i++) {
cout << " " << num[i];
}
cout << endl;
return (0);
}
|
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
| 1
| 145
|
#include <algorithm>
#include <iostream>
using namespace std;
double a[5];
int main() {
for (int i = 0; i < 5; i++) {
cin >> a[i];
}
sort(a, a + 4);
cout << a[4] << " " << a[3] << " " << a[2] << " " << a[1] << " " << a[0]
<< " " << endl;
return 0;
}
|
#include <algorithm>
#include <iostream>
using namespace std;
double a[5];
int main() {
for (int i = 0; i < 5; i++) {
cin >> a[i];
}
sort(a, a + 5);
cout << a[4] << " " << a[3] << " " << a[2] << " " << a[1] << " " << a[0]
<< endl;
return 0;
}
|
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
| 1
| 104
|
//
// main.cpp
// algorithm-practice1
//
// Created by g-2018 on 2017/04/28.
// Copyright ?? 2017??´ 3431. All rights reserved.
//
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
//****??´??????
//**** int a????????£?¨?
int a[5];
for (int i = 0; i < 5; i++) {
cin >> a[i];
}
//?????????
sort(a, a + 4);
for (int i = 4; i >= 0; i--) {
if (i != 4) {
cout << " ";
}
//**** ????????????
cout << a[i];
}
cout << endl;
}
|
//
// main.cpp
// algorithm-practice1
//
// Created by g-2018 on 2017/04/28.
// Copyright ?? 2017??´ 3431. All rights reserved.
//
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
//****??´??????
//**** int a????????£?¨?
int a[5];
for (int i = 0; i < 5; i++) {
cin >> a[i];
}
//?????????
sort(a, a + 5);
for (int i = 4; i >= 0; i--) {
if (i != 4) {
cout << " ";
}
//**** ????????????
cout << a[i];
}
cout << endl;
}
|
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
| 1
| 104
|
#include <bits/stdc++.h>
using namespace std;
vector<string> split(string &s, char delimiter) {
vector<string> res;
int prev_split_point = 0;
for (int i = 0; i < s.length(); i++) {
while (s[i] != delimiter && i < s.length())
i++;
string add = s.substr(prev_split_point, i - prev_split_point);
if (!add.empty())
res.push_back(add);
prev_split_point = i + 1;
}
return res;
}
int main(int argc, char *argv[]) {
char c[26];
for (int i = 0; i < 26; i++) {
c[i] = 'a' + i;
}
vector<string> vs;
string s;
string ans[] = {"this", "that", "the"};
vector<string> tmp;
while (getline(cin, s)) {
vs = split(s, ' ');
int n = vs.size();
for (int k = 0; k < 26; k++) {
tmp = vs;
for (int i = 0; i < vs.size(); i++) {
for (int j = 0; j < vs[i].length(); j++) {
if ('a' <= tmp[i][j] && tmp[i][j] <= 'z')
tmp[i][j] = c[(vs[i][j] - 'a' + k) % 25];
}
}
for (int i = 0; i < 3; i++) {
for (int j = 0; j < tmp.size(); j++) {
if (tmp[j] == ans[i]) {
k = 50, i = 10, j = 1000;
}
}
}
}
for (int i = 0; i < tmp.size(); i++) {
std::cout << tmp[i];
if (i == tmp.size() - 1)
std::cout << std::endl;
else
std::cout << " ";
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
vector<string> split(string &s, char delimiter) {
vector<string> res;
int prev_split_point = 0;
for (int i = 0; i < s.length(); i++) {
while (s[i] != delimiter && i < s.length())
i++;
string add = s.substr(prev_split_point, i - prev_split_point);
if (!add.empty())
res.push_back(add);
prev_split_point = i + 1;
}
return res;
}
int main(int argc, char *argv[]) {
char c[26];
for (int i = 0; i < 26; i++) {
c[i] = 'a' + i;
}
vector<string> vs;
string s;
string ans[] = {"this", "that", "the"};
vector<string> tmp;
while (getline(cin, s)) {
vs = split(s, ' ');
int n = vs.size();
for (int k = 0; k < 26; k++) {
tmp = vs;
for (int i = 0; i < vs.size(); i++) {
for (int j = 0; j < vs[i].length(); j++) {
if ('a' <= tmp[i][j] && tmp[i][j] <= 'z')
tmp[i][j] = c[(vs[i][j] - 'a' + k) % 26];
}
}
for (int i = 0; i < 3; i++) {
for (int j = 0; j < tmp.size(); j++) {
if (tmp[j] == ans[i]) {
k = 50, i = 10, j = 1000;
}
}
}
}
for (int i = 0; i < tmp.size(); i++) {
std::cout << tmp[i];
if (i == tmp.size() - 1)
std::cout << std::endl;
else
std::cout << " ";
}
}
return 0;
}
|
[["-", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13]]
| 1
| 464
|
#include <bits/stdc++.h>
using namespace std;
void f(string &s) {
for (char &c : s) {
if ('a' <= c && c <= 'z')
c = (c - 'a' + 25) % 26 + 'a';
}
}
int main() {
string s;
while (getline(cin, s)) {
if (s == "")
break;
while (s.find("the") != string::npos && s.find("this") != string::npos &&
s.find("that") != string::npos)
f(s);
cout << s << endl;
}
}
|
#include <bits/stdc++.h>
using namespace std;
void f(string &s) {
for (char &c : s) {
if ('a' <= c && c <= 'z')
c = (c - 'a' + 25) % 26 + 'a';
}
}
int main() {
string s;
while (getline(cin, s)) {
if (s == "")
break;
while (s.find("the") == string::npos && s.find("this") == string::npos &&
s.find("that") == string::npos)
f(s);
cout << s << endl;
}
}
|
[["-", 15, 339, 51, 16, 31, 16, 31, 16, 17, 79], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 60], ["-", 15, 339, 51, 16, 31, 16, 12, 16, 17, 79], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 60], ["-", 0, 52, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 17, 60]]
| 1
| 138
|
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
bool is_contain_keywords(string str, vector<string> &keywords) {
int cnt = 0;
vector<string>::iterator key_itr = keywords.begin();
while (key_itr != keywords.end()) {
if (str.find(*key_itr) != string::npos) {
return true;
}
key_itr++;
}
return false;
}
string decode(string cipher) {
vector<string> keywords;
keywords.push_back("the");
keywords.push_back("this");
keywords.push_back("that");
int remind_shift = -1;
int max_cnt = 0;
int str_len = cipher.length();
for (int shift = 0; shift < 'z' - 'a'; shift++) {
string str = cipher;
for (int i = 0; i < str_len; i++) {
if ('a' < cipher[i] && cipher[i] < 'z') {
str[i] = (cipher[i] - 'a' + shift) % ('z' - 'a') + 'a';
}
}
if (is_contain_keywords(str, keywords))
return str;
}
return "";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string cipher;
while (getline(cin, cipher)) {
cout << decode(cipher) << endl;
}
}
|
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
bool is_contain_keywords(string str, vector<string> &keywords) {
int cnt = 0;
vector<string>::iterator key_itr = keywords.begin();
while (key_itr != keywords.end()) {
if (str.find(*key_itr) != string::npos) {
return true;
}
key_itr++;
}
return false;
}
string decode(string cipher) {
vector<string> keywords;
keywords.push_back("the");
keywords.push_back("this");
keywords.push_back("that");
int remind_shift = -1;
int max_cnt = 0;
int str_len = cipher.length();
for (int shift = 0; shift < 'z' - 'a' + 1; shift++) {
string str = cipher;
for (int i = 0; i < str_len; i++) {
if ('a' <= cipher[i] && cipher[i] <= 'z') {
str[i] = (cipher[i] - 'a' + shift) % ('z' - 'a' + 1) + 'a';
}
}
if (is_contain_keywords(str, keywords))
return str;
}
return "";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string cipher;
while (getline(cin, cipher)) {
cout << decode(cipher) << endl;
}
}
|
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 12, 13]]
| 1
| 297
|
#include <bits/stdc++.h>
using namespace std;
#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define X real()
#define Y imag()
#define value(x, y, w, h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(), (r).end()
#define gsort(st, en) sort((st), (en), greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout << #x << ": " << x << endl
#define fcout(n) cout << fixed << setprecision((n))
#define scout(n) cout << setw(n)
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define repc(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define repi(it, array) \
for (auto it = array.begin(), end = array.end(); it != end; ++it)
#define repa(n, array) for (auto &n : (array))
typedef long long ll;
typedef deque<int> di;
typedef deque<ll> dl;
typedef map<string, int> dict;
typedef complex<double> comd;
typedef pair<int, int> pii;
constexpr int imax = ((1 << 30) - 1) * 2 + 1;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0);
double eps = 1e-10;
const int dy[] = {-1, 0, 1, 0};
const int dx[] = {0, -1, 0, 1};
double CalcDist(comd p1, comd p2) {
return sqrt(pow(p1.X - p2.X, 2.0) + pow(p1.Y - p2.Y, 2.0));
}
template <typename T> void out(deque<T> d) {
for (size_t i = 0; i < d.size(); i++) {
debug(d[i]);
}
}
template <typename T> T ston(string &str, T n) {
istringstream sin(str);
T num;
sin >> num;
return num;
}
string Decode(string s, int n) {
string res = s;
rep(i, s.size()) {
if (s[i] != '.' && s[i] != ' ') {
if (s[i] + n > 'z') {
res[i] = 'a' + (s[i] + n - 'z') - 1;
} else {
res[i] = s[i] + n;
}
}
}
return res;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s;
int code;
vector<string> vs;
while (1) {
code = 0;
getline(cin, s);
if (cin.eof())
break;
rep(i, 27) {
if (Decode(s, i).find("this") != string::npos ||
Decode(s, i).find("that") != string::npos ||
Decode(s, i).find("thread_local") != string::npos) {
code = i;
break;
}
}
cout << Decode(s, code) << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define X real()
#define Y imag()
#define value(x, y, w, h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(), (r).end()
#define gsort(st, en) sort((st), (en), greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout << #x << ": " << x << endl
#define fcout(n) cout << fixed << setprecision((n))
#define scout(n) cout << setw(n)
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define repc(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define repi(it, array) \
for (auto it = array.begin(), end = array.end(); it != end; ++it)
#define repa(n, array) for (auto &n : (array))
typedef long long ll;
typedef deque<int> di;
typedef deque<ll> dl;
typedef map<string, int> dict;
typedef complex<double> comd;
typedef pair<int, int> pii;
constexpr int imax = ((1 << 30) - 1) * 2 + 1;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0);
double eps = 1e-10;
const int dy[] = {-1, 0, 1, 0};
const int dx[] = {0, -1, 0, 1};
double CalcDist(comd p1, comd p2) {
return sqrt(pow(p1.X - p2.X, 2.0) + pow(p1.Y - p2.Y, 2.0));
}
template <typename T> void out(deque<T> d) {
for (size_t i = 0; i < d.size(); i++) {
debug(d[i]);
}
}
template <typename T> T ston(string &str, T n) {
istringstream sin(str);
T num;
sin >> num;
return num;
}
string Decode(string s, int n) {
string res = s;
rep(i, s.size()) {
if (s[i] != '.' && s[i] != ' ') {
if (s[i] + n > 'z') {
res[i] = 'a' + (s[i] + n - 'z') - 1;
} else {
res[i] = s[i] + n;
}
}
}
return res;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s;
int code;
vector<string> vs;
while (1) {
code = 0;
getline(cin, s);
if (cin.eof())
break;
rep(i, 27) {
if (Decode(s, i).find("this") != string::npos ||
Decode(s, i).find("that") != string::npos ||
Decode(s, i).find("the") != string::npos) {
code = i;
break;
}
}
cout << Decode(s, code) << endl;
}
return 0;
}
|
[["-", 12, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 12, 16, 31, 2, 3, 4, 0, 5, 0, 6]]
| 1
| 604
|
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
while (getline(cin, s)) {
string dec = s;
while (true) {
if (dec.find("the") != -1 || dec.find("this") != -1 ||
dec.find("that") != -1) {
cout << dec << endl;
break;
}
for (int i = 0; i < dec.size(); i++) {
if ('a' <= dec[i] && dec[i] < 'z')
dec[i]++;
if (dec[i] == 'z')
dec[i] = 'a';
}
}
}
return 0;
}
|
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
while (getline(cin, s)) {
string dec = s;
while (true) {
if (dec.find("the") != -1 || dec.find("this") != -1 ||
dec.find("that") != -1) {
cout << dec << endl;
break;
}
for (int i = 0; i < dec.size(); i++) {
if ('a' <= dec[i] && dec[i] < 'z')
dec[i]++;
else if (dec[i] == 'z')
dec[i] = 'a';
}
}
}
return 0;
}
|
[["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]]
| 1
| 153
|
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define PUSH(n, v) \
for (int i = 0; i < (n); i++) { \
int j; \
cin >> j; \
v.push_back(j); \
}
#define ALL(v) v.begin(), v.end()
void rot1(string &s) {
string t = "";
REP(i, s.size()) {
if (s[i] > 'a' && s[i] < 'z') {
if (s[i] == 'a')
t += "z";
else
t += s[i] - 1;
} else {
t += s[i];
}
}
s = t;
}
int main() {
string s;
while (getline(cin, s)) {
while (s.find("the") == string::npos && s.find("this") == string::npos &&
s.find("that") == string::npos) {
rot1(s);
}
cout << s << endl;
}
return 0;
}
|
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define PUSH(n, v) \
for (int i = 0; i < (n); i++) { \
int j; \
cin >> j; \
v.push_back(j); \
}
#define ALL(v) v.begin(), v.end()
void rot1(string &s) {
string t = "";
REP(i, s.size()) {
if (s[i] >= 'a' && s[i] <= 'z') {
if (s[i] == 'a')
t += "z";
else
t += s[i] - 1;
} else {
t += s[i];
}
}
s = t;
}
int main() {
string s;
while (getline(cin, s)) {
while (s.find("the") == string::npos && s.find("this") == string::npos &&
s.find("that") == string::npos) {
rot1(s);
}
cout << s << endl;
}
return 0;
}
|
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 20], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19]]
| 1
| 221
|
#include <stdio.h>
int check(int a, int b, int c) {
// printf("[%d][%d][%d]\n",a,b,c);
if (a != 14)
return 0;
else if (b == 23)
return 1;
else if (b == 1 && c == 10)
return 1;
else if (b == 19 && c == 19)
return 1;
else
return 0;
}
int main() {
int longth, mem = 0;
while (1) {
char str[90] = {0};
int mem1[90] = {0}, mem2[90] = {0};
if (scanf("%c", &str[0]) == -1)
return 0;
if (str[0] >= 'a' && 'z' >= str[0])
mem1[0] = str[0] - 'a' + 1;
for (int i = 1; i < 80; i++) {
scanf("%c", &str[i]);
if (str[i] == '\n')
break;
longth = i;
if (str[i] >= 'a' && 'z' >= str[i])
mem1[i] = str[i] - 'a' + 1;
}
for (int i = 0; i < longth; i++) {
if (mem1[i] == 0)
;
else if (mem1[i + 1] != 0) {
if (mem1[i] <= mem1[i + 1])
mem2[i] = mem1[i + 1] - mem1[i];
else
mem2[i] = 26 - mem1[i] + mem1[i + 1];
}
}
/*for(int i = 0; i < longth; i++)
{
printf("[%d]",mem2[i]);
}
printf("\n");*/
for (int i = 0; i < longth; i++) {
// if(mem2[i] == 0);
/*else */ if (i == 0) /*printf("[%d]\n",i);*/
if (check(mem2[i], mem2[i + 1], mem2[i + 2]))
if (mem1[i] <= 20)
mem = 20 - mem1[i];
else
mem = 26 - mem1[i] + 20;
// else if(mem2[i - 1] == 0)/*printf("{%d}\n",i);*/if(check(mem2[i],mem2[i
// + 1],mem2[i + 2])if(mem1[i] <= 20)mem = 20 - mem1[i];else mem = 26 -
// mem1[i] + 20; else printf("no\n");
}
// printf("{{%d}}\n",mem);
for (int i = 0; i < longth + 1; i++) {
if (str[i] >= 'a' && 'z' >= str[i])
printf("%c", (str[i] - 'a' + mem) % 26 + 'a');
else
printf("%c", str[i]);
}
printf("\n");
}
}
|
#include <stdio.h>
int check(int a, int b, int c) {
// printf("[%d][%d][%d]\n",a,b,c);
if (a != 14)
return 0;
else if (b == 23)
return 1;
else if (b == 1 && c == 10)
return 1;
else if (b == 19 && c == 19)
return 1;
else
return 0;
}
int main() {
int longth, mem = 0;
while (1) {
char str[90] = {0};
int mem1[90] = {0}, mem2[90] = {0};
if (scanf("%c", &str[0]) == -1)
return 0;
if (str[0] >= 'a' && 'z' >= str[0])
mem1[0] = str[0] - 'a' + 1;
for (int i = 1; i < 80; i++) {
scanf("%c", &str[i]);
if (str[i] == '\n')
break;
longth = i;
if (str[i] >= 'a' && 'z' >= str[i])
mem1[i] = str[i] - 'a' + 1;
}
for (int i = 0; i < longth; i++) {
if (mem1[i] == 0)
;
else if (mem1[i + 1] != 0) {
if (mem1[i] <= mem1[i + 1])
mem2[i] = mem1[i + 1] - mem1[i];
else
mem2[i] = 26 - mem1[i] + mem1[i + 1];
}
}
/*for(int i = 0; i < longth; i++)
{
printf("[%d]",mem2[i]);
}
printf("\n");*/
for (int i = 0; i < longth; i++) {
if (mem2[i] != 0) /*printf("[%d]\n",i);*/
if (check(mem2[i], mem2[i + 1], mem2[i + 2]))
if (mem1[i] <= 20)
mem = 20 - mem1[i];
else
mem = 26 - mem1[i] + 20;
// else printf("no\n");
}
// printf("{{%d}}\n",mem);
for (int i = 0; i < longth + 1; i++) {
if (str[i] >= 'a' && 'z' >= str[i])
printf("%c", (str[i] - 'a' + mem) % 26 + 'a');
else
printf("%c", str[i]);
}
printf("\n");
}
}
|
[["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
| 1
| 513
|
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for (int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for (int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
int main() {
string s;
while (getline(cin, s)) {
rep(i, 26) {
rep(j, s.size()) {
if ('a' <= s[j] && s[j] <= 'z')
s[j] = s[j] + 'a';
else if (s[j] == 'z')
s[j] = 'a';
}
if (s.find("the") != string::npos || s.find("this") != string::npos ||
s.find("that") != string::npos) {
cout << s << endl;
}
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for (int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for (int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
int main() {
string s;
while (getline(cin, s)) {
rep(i, 26) {
rep(j, s.size()) {
if ('a' <= s[j] && s[j] < 'z')
s[j] = s[j] + 1;
else if (s[j] == 'z')
s[j] = 'a';
}
if (s.find("the") != string::npos || s.find("this") != string::npos ||
s.find("that") != string::npos) {
cout << s << endl;
}
}
}
return 0;
}
|
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["-", 64, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["-", 64, 1, 0, 11, 12, 16, 12, 103, 0, 125], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 13]]
| 1
| 206
|
#include <cassert>
#include <iostream>
#include <string>
using namespace std;
bool IncludeKeyWords(const string &Sentence) {
if (Sentence.find("the") <= 80)
return true;
if (Sentence.find("this") <= 80)
return true;
if (Sentence.find("that") <= 80)
return true;
return false;
}
string OneShift(string Sentence) {
for (int i = 0; i < Sentence.size(); i++) {
if (97 < Sentence[i] && Sentence[i] < 123) {
Sentence[i]--;
} else if (Sentence[i] == 97) {
Sentence[i] = 123;
}
}
return Sentence;
}
string Decrypt(string Sentence) {
int RoopCount = 0;
while (IncludeKeyWords(Sentence) == false) {
assert(RoopCount < 26);
Sentence = OneShift(Sentence);
RoopCount++;
}
return Sentence;
}
int main() {
while (true) {
string Sentence;
getline(cin, Sentence);
if (cin.eof() == true)
break;
string DecryptedSentence = Decrypt(Sentence);
cout << DecryptedSentence << endl;
}
return 0;
}
|
#include <cassert>
#include <iostream>
#include <string>
using namespace std;
bool IncludeKeyWords(const string &Sentence) {
if (Sentence.find("the") <= 80)
return true;
if (Sentence.find("this") <= 80)
return true;
if (Sentence.find("that") <= 80)
return true;
return false;
}
string OneShift(string Sentence) {
for (int i = 0; i < Sentence.size(); i++) {
if (97 < Sentence[i] && Sentence[i] < 123) {
Sentence[i]--;
} else if (Sentence[i] == 97) {
Sentence[i] = 122;
}
}
return Sentence;
}
string Decrypt(string Sentence) {
int RoopCount = 0;
while (IncludeKeyWords(Sentence) == false) {
assert(RoopCount < 26);
Sentence = OneShift(Sentence);
RoopCount++;
}
return Sentence;
}
int main() {
while (true) {
string Sentence;
getline(cin, Sentence);
if (cin.eof() == true)
break;
string DecryptedSentence = Decrypt(Sentence);
cout << DecryptedSentence << endl;
}
return 0;
}
|
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13]]
| 1
| 240
|
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <ctype.h>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <utility>
#include <vector>
using namespace std;
char c[85];
bool search_th() {
bool f = false;
for (int i = 0; i < strlen(c); i++) {
if ((c[i] == 't' && c[i + 1] == 'h' && c[i + 2] == 'e') ||
(c[i] == 't' && c[i + 1] == 'h' && c[i + 2] == 'i' &&
c[i + 3] == 's') ||
(c[i] == 't' && c[i + 1] == 'h' && c[i + 2] == 'a' &&
c[i + 3] == 't')) {
f = true;
break;
}
}
return f;
}
int main() {
while (cin.getline(c, sizeof(c))) {
while (1) {
if (search_th() == true) {
cout << c << endl;
break;
}
for (int j = 0; j < strlen(c); j++) {
if (c[j] >= 'a' && c[j] <= 'y')
c[j]++;
if (c[j] == 'z')
c[j] = 'a';
}
}
for (int i = strlen(c); i < 85; i++) {
c[i] = '\0';
}
}
return 0;
}
|
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <ctype.h>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <utility>
#include <vector>
using namespace std;
char c[85];
bool search_th() {
bool f = false;
for (int i = 0; i < strlen(c); i++) {
if ((c[i] == 't' && c[i + 1] == 'h' && c[i + 2] == 'e') ||
(c[i] == 't' && c[i + 1] == 'h' && c[i + 2] == 'i' &&
c[i + 3] == 's') ||
(c[i] == 't' && c[i + 1] == 'h' && c[i + 2] == 'a' &&
c[i + 3] == 't')) {
f = true;
break;
}
}
return f;
}
int main() {
while (cin.getline(c, sizeof(c))) {
while (1) {
if (search_th() == true) {
cout << c << endl;
break;
}
for (int j = 0; j < strlen(c); j++) {
if (c[j] >= 'a' && c[j] <= 'y') {
c[j]++;
} else if (c[j] == 'z') {
c[j] = 'a';
}
}
}
for (int i = strlen(c); i < 85; i++) {
c[i] = '\0';
}
}
return 0;
}
|
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 64, 9, 0, 45], ["+", 0, 57, 75, 76, 0, 57, 64, 9, 0, 46]]
| 1
| 352
|
#include <cstring>
#include <iostream>
#include <string>
bool find(const std::string &text, const std::string pattern) {
int text_i = 0, pattern_i = 0;
while (text_i < text.size() && pattern_i < pattern.size()) {
if (text[text_i] == pattern[pattern_i]) {
text_i++;
pattern_i++;
} else {
pattern_i = 0;
text_i = text_i - pattern_i + 1;
}
}
return (pattern_i == pattern.size() ? true : false);
}
void decode(std::string &coded_data, int diff) {
for (int i = 0; i < coded_data.size(); i++) {
if (isalpha(coded_data[i])) {
coded_data[i] -= diff;
if (!isalpha(coded_data[i]))
coded_data[i] += 26;
}
}
}
int main(void) {
std::string coded_data;
while (std::getline(std::cin, coded_data)) {
for (int i = 1; i < 26; i++) {
decode(coded_data, 1);
if (find(coded_data, "the") && find(coded_data, "this") &&
find(coded_data, "that"))
std::cout << coded_data << std::endl;
}
}
return 0;
}
|
#include <cstring>
#include <iostream>
#include <string>
bool find(const std::string &text, const std::string pattern) {
int text_i = 0, pattern_i = 0;
while (text_i < text.size() && pattern_i < pattern.size()) {
if (text[text_i] == pattern[pattern_i]) {
text_i++;
pattern_i++;
} else {
pattern_i = 0;
text_i = text_i - pattern_i + 1;
}
}
return (pattern_i == pattern.size() ? true : false);
}
void decode(std::string &coded_data, int diff) {
for (int i = 0; i < coded_data.size(); i++) {
if (isalpha(coded_data[i])) {
coded_data[i] -= diff;
if (!isalpha(coded_data[i]))
coded_data[i] += 26;
}
}
}
int main(void) {
std::string coded_data;
while (std::getline(std::cin, coded_data)) {
for (int i = 0; i < 26; i++) {
decode(coded_data, 1);
if (find(coded_data, "the") || find(coded_data, "this") ||
find(coded_data, "that"))
std::cout << coded_data << std::endl;
}
}
return 0;
}
|
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 106], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
| 1
| 266
|
#include <iostream>
#include <string>
using namespace std;
void next(string &str) {
for (int i = 0; i < str.length(); i++) {
if ('a' <= str[i] && str[i] < 'z') {
str[i] = ((str[i] - 'a' + 25) % 26) + 'a';
}
}
}
int main() {
string str;
while (getline(cin, str)) {
for (int i = 0; i < 26; ++i, next(str)) {
if (-1 != str.find("the") || -1 != str.find("this") ||
-1 != str.find("that")) {
cout << str << endl;
break;
}
}
}
return 0;
}
|
#include <iostream>
#include <string>
using namespace std;
void next(string &str) {
for (int i = 0; i < str.length(); i++) {
if ('a' <= str[i] && str[i] <= 'z') {
str[i] = ((str[i] - 'a' + 25) % 26) + 'a';
}
}
}
int main() {
string str;
while (getline(cin, str)) {
for (int i = 0; i < 26; ++i, next(str)) {
if (-1 != str.find("the") || -1 != str.find("this") ||
-1 != str.find("that")) {
cout << str << endl;
break;
}
}
}
return 0;
}
|
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19]]
| 1
| 174
|
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
using namespace std;
char ch;
string text;
int main() {
while (getline(cin, text)) {
for (int i = 0; i < 26; i++) {
for (int j = 0; j < text.size(); j++) {
if (text[j] >= 'a' && text[j] <= 'y')
text[j] += 1;
if (text[j] == 'z')
text[j] = 'a';
}
int p = text.find("the"), q = text.find("this"), r = text.find("that");
if (p != string::npos || q != string::npos || r != string::npos) {
cout << text << endl;
break;
}
}
}
}
|
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
using namespace std;
char ch;
string text;
int main() {
while (getline(cin, text)) {
for (int i = 0; i < 26; i++) {
for (int j = 0; j < text.size(); j++) {
if (text[j] >= 'a' && text[j] <= 'y')
text[j] += 1;
else if (text[j] == 'z')
text[j] = 'a';
}
int p = text.find("the"), q = text.find("this"), r = text.find("that");
if (p != string::npos || q != string::npos || r != string::npos) {
cout << text << endl;
break;
}
}
}
}
|
[["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]]
| 1
| 190
|
#include <iostream>
#include <string>
using namespace std;
int main() {
string str, t;
while (getline(cin, str)) {
for (int i = 1; i < 26; ++i) {
t = str;
for (int j = 0; j < str.size(); ++j) {
if (t[j] == ' ' || t[j] == '.')
continue;
t[j] = (t[j] - 'a' + i) % 26 + 'a';
}
if (t.find("that", 0) != string::npos &&
t.find("this", 0) != string::npos &&
t.find("the", 0) != string::npos) {
cout << t << endl;
break;
}
}
}
return 0;
}
|
#include <iostream>
#include <string>
using namespace std;
int main() {
string str, t;
while (getline(cin, str)) {
for (int i = 0; i < 26; ++i) {
t = str;
for (int j = 0; j < str.size(); ++j) {
if (t[j] == ' ' || t[j] == '.')
continue;
t[j] = (t[j] - 'a' + i) % 26 + 'a';
}
if (t.find("that", 0) != string::npos ||
t.find("this", 0) != string::npos ||
t.find("the", 0) != string::npos) {
cout << t << endl;
break;
}
}
}
return 0;
}
|
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 106], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
| 1
| 176
|
#include <stdio.h>
#include <string.h>
int main(void) {
char data[100];
char s1[] = "the", s2[] = "this", s3[] = "that";
int i, cnt = 0;
char *p;
while ((fgets(data, 100, stdin))) {
while (cnt <= 26) {
p = strstr(data, s1);
if (p)
break;
p = strstr(data, s2);
if (p)
break;
p = strstr(data, s3);
if (p)
break;
for (i = 0; i < 100; i++) {
if (data[i] == '\0')
break;
if ('a' <= data[i] && data[i] <= 'y')
data[i]++;
if ('z' == data[i])
data[i] = 'a';
}
cnt++;
}
cnt = 0;
printf("%s\n", data);
}
return 0;
}
|
#include <stdio.h>
#include <string.h>
int main(void) {
char data[100];
char s1[] = "the", s2[] = "this", s3[] = "that";
int i, cnt = 0;
char *p;
while ((fgets(data, 100, stdin))) {
while (cnt < 26) {
p = strstr(data, s1);
if (p)
break;
p = strstr(data, s2);
if (p)
break;
p = strstr(data, s3);
if (p)
break;
for (i = 0; i < 100; i++) {
if (data[i] == '\0')
break;
if ('a' <= data[i] && data[i] <= 'y')
data[i]++;
else if ('z' == data[i])
data[i] = 'a';
}
cnt++;
}
cnt = 0;
printf("%s", data);
}
return 0;
}
|
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
| 1
| 215
|
#include <iostream>
#include <string>
bool NotMatch(const std::string &str) {
return str.find("the") == std::string::npos &&
str.find("this") == std::string::npos &&
str.find("that") == std::string::npos;
}
int main() {
std::string str;
while (getline(std::cin, str)) {
while (NotMatch(str)) {
for (unsigned i = 0; i < str.length(); ++i) {
if (str[i] == '.' || str[i] == ' ' || str[i] == '\n') {
continue;
}
if (str[i] == 'z') {
str[i] = 'a';
} else {
--str[i];
}
}
}
std::cout << str << '\n';
}
}
|
#include <iostream>
#include <string>
bool NotMatch(const std::string &str) {
return str.find("the") == std::string::npos &&
str.find("this") == std::string::npos &&
str.find("that") == std::string::npos;
}
int main() {
std::string str;
while (getline(std::cin, str)) {
while (NotMatch(str)) {
for (unsigned i = 0; i < str.length(); ++i) {
if (str[i] == '.' || str[i] == ' ' || str[i] == '\n') {
continue;
}
if (str[i] == 'z') {
str[i] = 'a';
} else {
++str[i];
}
}
}
std::cout << str << '\n';
}
}
|
[["-", 75, 76, 0, 9, 0, 1, 0, 27, 17, 68], ["+", 75, 76, 0, 9, 0, 1, 0, 27, 17, 29]]
| 1
| 189
|
#include <algorithm>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
bool solve() {
string s;
while (getline(cin, s)) {
string str[26];
int num;
for (int i = 0; i < 26; i++) {
str[i] = s;
for (int j = 0; j < str[i].size(); j++) {
for (int k = 0; k < i; k++) {
if (str[i][j] == '.' || str[i][j] == ' ') {
continue;
}
if (str[i][j] == 'a') {
str[i][j] = 'z';
}
str[i][j]--;
}
}
for (int j = 0; j < str[i].size(); j++) {
string str_temp, str_temp2;
if (j + 3 < str[i].size()) {
str_temp = str[i].substr(j, 3);
}
if (j + 4 < str[i].size()) {
str_temp2 = str[i].substr(j, 4);
}
if (str_temp == "the" || str_temp2 == "this" || str_temp2 == "that") {
num = i;
}
}
}
cout << str[num] << endl;
}
return true;
}
int main() {
cout.setf(ios::fixed);
cout.precision(10);
solve();
return 0;
}
|
#include <algorithm>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
bool solve() {
string s;
while (getline(cin, s)) {
string str[26];
int num;
for (int i = 0; i < 26; i++) {
str[i] = s;
for (int j = 0; j < str[i].size(); j++) {
for (int k = 0; k < i; k++) {
if (str[i][j] == '.' || str[i][j] == ' ') {
continue;
}
if (str[i][j] == 'a') {
str[i][j] = 'z';
continue;
}
str[i][j]--;
}
}
for (int j = 0; j < str[i].size(); j++) {
string str_temp, str_temp2;
if (j + 3 <= str[i].size()) {
str_temp = str[i].substr(j, 3);
}
if (j + 4 <= str[i].size()) {
str_temp2 = str[i].substr(j, 4);
}
if (str_temp == "the" || str_temp2 == "this" || str_temp2 == "that") {
num = i;
}
}
}
cout << str[num] << endl;
}
return true;
}
int main() {
cout.setf(ios::fixed);
cout.precision(10);
solve();
return 0;
}
|
[["+", 8, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["+", 8, 9, 0, 57, 64, 9, 0, 116, 0, 35], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
| 1
| 337
|
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
string s;
while (getline(cin, s)) {
while (s.find("that") == string::npos && s.find("the") == string::npos &&
s.find("this") == string::npos) {
for (int i = 0; i < s.length(); ++i) {
if (s[i] < 'z' && s[i] >= 'a')
s[i]++;
if (s[i] == 'z')
s[i] = 'a';
}
}
cout << s << endl;
}
return 0;
}
|
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
string s;
while (getline(cin, s)) {
while (s.find("that") == string::npos && s.find("the") == string::npos &&
s.find("this") == string::npos) {
for (int i = 0; i < s.length(); ++i) {
if (s[i] < 'z' && s[i] >= 'a')
s[i]++;
else if (s[i] == 'z')
s[i] = 'a';
}
}
cout << s << endl;
}
return 0;
}
|
[["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]]
| 1
| 152
|
# coding: UTF-8
alphabets = "abcdefghijklmnopqrstuvwxyz"
while input = gets
gets.chomp!
26.times.with_index do |i|
output = input.tr("a-z", alphabets.split("").rotate(i).join)
if output =~ /th(e|is|at)/
puts output
break
end
end
end
|
# coding: UTF-8
alphabets = "abcdefghijklmnopqrstuvwxyz"
while input = gets
input.chomp!
26.times.with_index do |i|
output = input.tr("a-z", alphabets.split("").rotate(i).join)
if output =~ /th(e|is|at)/
puts output
break
end
end
end
|
[["-", 0, 493, 0, 89, 8, 170, 0, 652, 486, 22], ["+", 0, 493, 0, 89, 8, 170, 0, 652, 486, 22]]
| 4
| 59
|
#include <algorithm>
#include <iostream>
using namespace std;
int main(void) {
int a[5];
for (int i = 0; i < 5; ++i)
cin >> a[i];
sort(a, a + 5);
for (int i = 4; 0 <= i; --i)
cout << ((i != 0) ? " " : "") << a[i];
cout << endl;
return 0;
}
|
#include <algorithm>
#include <iostream>
using namespace std;
int main(void) {
int a[5];
for (int i = 0; i < 5; ++i)
cin >> a[i];
sort(a, a + 5);
for (int i = 4; 0 <= i; --i)
cout << ((i != 4) ? " " : "") << a[i];
cout << endl;
return 0;
}
|
[["-", 12, 23, 0, 41, 15, 23, 0, 16, 12, 13], ["+", 12, 23, 0, 41, 15, 23, 0, 16, 12, 13]]
| 1
| 94
|
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a[5];
for (int i = 0; i < 5; i++) {
cin >> a[i];
}
sort(a, a + 5);
reverse(a, a + 5);
cout << a[0];
for (int j = 1; j >= 5; j++) {
cout << " " << a[j];
}
cout << endl;
return 0;
}
|
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a[5];
for (int i = 0; i < 5; i++) {
cin >> a[i];
}
sort(a, a + 5);
reverse(a, a + 5);
cout << a[0];
for (int j = 1; j < 5; j++) {
cout << " " << a[j];
}
cout << endl;
return 0;
}
|
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
| 1
| 102
|
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
using namespace std;
int main() {
string str;
int num[5];
for (int i = 0; i < 5; i++) {
scanf("%d", num + i);
}
sort(num, num + 5, greater<int>());
for (int i = 0; i < 5; i++) {
printf("%d%s", num[i], i == 4 ? '\n' : ' ');
}
return 0;
}
|
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
using namespace std;
int main() {
int num[5];
for (int i = 0; i < 5; i++) {
scanf("%d", num + i);
}
sort(num, num + 5, greater<int>());
for (int i = 0; i < 5; i++) {
printf("%d%s", num[i], i == 4 ? "\n" : " ");
}
return 0;
}
|
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 2, 3, 4, 0, 41, 64, 103, 0, 104], ["+", 0, 2, 3, 4, 0, 41, 64, 5, 0, 62], ["-", 0, 2, 3, 4, 0, 41, 75, 103, 0, 104], ["+", 0, 2, 3, 4, 0, 41, 75, 5, 0, 62]]
| 1
| 119
|
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a[5], i;
for (i = 0; i < 5; i++) {
cin >> a[i];
}
sort(a, a + 5, greater<int>());
for (i = 0; i < 5; i++) {
cout << a[i];
if (i < 3)
cout << ' ';
else
cout << endl;
}
return 0;
}
|
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a[5], i;
for (i = 0; i < 5; i++) {
cin >> a[i];
}
sort(a, a + 5, greater<int>());
for (i = 0; i < 5; i++) {
cout << a[i];
if (i < 4)
cout << ' ';
else
cout << endl;
}
return 0;
}
|
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
| 1
| 102
|
#include <iostream>
using namespace std;
int main() {
int a[5];
cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];
for (int i = 0; i < 5; i++) {
for (int l = 0; l < 4; l++) {
if (a[l] < a[l + 1]) {
int c = a[l];
a[l] = a[l + 1];
a[l + 1] = a[l];
}
}
}
cout << a[0] << " " << a[1] << " " << a[2] << " " << a[3] << " " << a[4]
<< endl;
return 0;
}
|
#include <iostream>
using namespace std;
int main() {
int a[5];
cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];
for (int i = 0; i < 5; i++) {
for (int l = 0; l < 4; l++) {
if (a[l] < a[l + 1]) {
int c = a[l];
a[l] = a[l + 1];
a[l + 1] = c;
}
}
}
cout << a[0] << " " << a[1] << " " << a[2] << " " << a[3] << " " << a[4]
<< endl;
return 0;
}
|
[["-", 64, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 70], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 73], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
| 1
| 173
|
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> lot(5);
for (int i = 0; i < 5; i++)
cin >> lot[i];
sort(lot.begin(), lot.end());
for (int i = 0; i < 5; i++) {
cout << lot[i];
if (i == 4)
cout << endl;
else
cout << " ";
}
return 0;
}
|
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> lot(5);
for (int i = 0; i < 5; i++)
cin >> lot[i];
sort(lot.begin(), lot.end());
for (int i = 0; i < 5; i++) {
cout << lot[4 - i];
if (i == 4)
cout << endl;
else
cout << " ";
}
return 0;
}
|
[["+", 0, 16, 12, 69, 341, 342, 0, 16, 31, 13], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 17, 33]]
| 1
| 104
|
#include <algorithm>
#include <array>
#include <cstdint>
#include <iostream>
#include <iterator>
int main() {
std::array<std::uint32_t, 5> numbers;
for (std::uint32_t &num : numbers) {
std::cin >> num;
}
std::sort(numbers.begin(), numbers.end(), std::greater<std::uint32_t>());
std::copy(numbers.begin(), numbers.end() - 1,
std::ostream_iterator<std::uint32_t>(std::cout, " "));
std::cout << numbers.back() << std::endl;
return 0;
}
|
#include <algorithm>
#include <array>
#include <cstdint>
#include <iostream>
#include <iterator>
int main() {
std::array<std::int32_t, 5> numbers;
for (std::int32_t &num : numbers) {
std::cin >> num;
}
std::sort(numbers.begin(), numbers.end(), std::greater<std::int32_t>());
std::copy(numbers.begin(), numbers.end() - 1,
std::ostream_iterator<std::int32_t>(std::cout, " "));
std::cout << numbers.back() << std::endl;
return 0;
}
|
[["-", 141, 344, 3, 347, 0, 77, 39, 343, 141, 78], ["+", 141, 344, 3, 347, 0, 77, 39, 343, 141, 78], ["-", 0, 14, 8, 9, 0, 338, 39, 343, 141, 78], ["+", 0, 14, 8, 9, 0, 338, 39, 343, 141, 78], ["-", 141, 346, 3, 347, 0, 77, 39, 343, 141, 78], ["+", 141, 346, 3, 347, 0, 77, 39, 343, 141, 78]]
| 1
| 128
|
#include <algorithm>
#include <functional>
#include <iostream>
using namespace std;
int main() {
int input[5];
for (int i = 0; i < 5; i++)
cin >> input[i];
sort(input, input + 5, greater<int>());
cout << input[0] << " " << input[1] << " " << input[2] << " " << input[3];
cout << input[4] << endl;
return 0;
}
|
#include <algorithm>
#include <functional>
#include <iostream>
using namespace std;
int main() {
int input[5];
for (int i = 0; i < 5; i++)
cin >> input[i];
sort(input, input + 5, greater<int>());
cout << input[0] << " " << input[1] << " " << input[2] << " " << input[3];
cout << " " << input[4] << endl;
return 0;
}
|
[["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]]
| 1
| 105
|
#include <algorithm>
#include <functional>
#include <iostream>
using namespace std;
int main() {
int a[5];
for (int i = 0; i < 5; i++) {
cin >> a[i];
}
sort(a, a + 5, greater<int>());
for (int i = 0; i < 5; i++) {
cout << a[i] << " ";
}
cout << "\b" << endl;
return 0;
}
|
#include <algorithm>
#include <functional>
#include <iostream>
using namespace std;
int main() {
int a[5];
for (int i = 0; i < 5; i++) {
cin >> a[i];
}
sort(a, a + 5, greater<int>());
for (int i = 0; i < 4; i++) {
cout << a[i] << " ";
}
cout << a[4] << endl;
return 0;
}
|
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 44], ["+", 0, 1, 0, 16, 31, 16, 12, 69, 28, 22], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 70], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 73]]
| 1
| 99
|
#include <algorithm>
#include <iostream>
int main() {
int a[5];
for (int i = 0; i < 5; ++i)
std::cin >> a[i];
std::sort(a, a + 5, std::greater<int>());
std::cout << a[0];
for (int i = 1; i < 5; ++i)
std::cout << a[i];
std::cout << std::endl;
}
|
#include <algorithm>
#include <iostream>
int main() {
int a[5];
for (int i = 0; i < 5; ++i)
std::cin >> a[i];
std::sort(a, a + 5, std::greater<int>());
std::cout << a[0];
for (int i = 1; i < 5; ++i)
std::cout << " " << a[i];
std::cout << std::endl;
}
|
[["+", 8, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["+", 8, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 7, 8, 1, 0, 16, 17, 151]]
| 1
| 99
|
#include <stdio.h>
int main(void) {
int i, j, temp;
int data[5];
for (i = 0; i < 5; i++) {
scanf("%d", &data[i]);
}
for (i = 0; i < 4; i++) {
for (j = i + 1; j < 5; j++) {
if (data[i] < data[j]) {
temp = data[i];
data[i] = data[j];
data[j] = temp;
}
}
}
for (i = 0; i < 4; i++) {
printf("%d ", data[i]);
}
printf("%d\n", data[5 - 1]);
return 0;
}
|
#include <stdio.h>
int main(void) {
int i, j, temp;
int data[5];
for (i = 0; i < 5; i++) {
scanf("%d", &data[i]);
}
for (i = 0; i < 4; i++) {
for (j = i + 1; j < 5; j++) {
if (data[i] < data[j]) {
temp = data[i];
data[i] = data[j];
data[j] = temp;
}
}
}
for (i = 0; i < 4; i++) {
printf("%d ", data[i]);
}
printf("%d\n", data[5 - 1]);
return 0;
}
|
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
| 1
| 165
|
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
char ch[5];
for (int i = 0; i < 5; i++) {
cin >> ch[i];
}
sort(ch, ch + 4, greater<int>());
for (int i = 0; i < 4; i++) {
cout << ch[i] << " ";
}
cout << ch[4] << endl;
}
|
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int ch[5];
for (int i = 0; i < 5; i++) {
cin >> ch[i];
}
sort(ch, ch + 5, greater<int>());
for (int i = 0; i < 4; i++) {
cout << ch[i] << " ";
}
cout << ch[4] << endl;
}
|
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
| 1
| 97
|
num = gets.split(&:to_i)
num = num.sort.reverse
puts num.join(" ")
|
num = gets.split.map(&:to_i)
num = num.sort.reverse
puts num.join(" ")
|
[["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
| 4
| 25
|
puts gets.split.map(&:to_i).sort.join(" ")
|
puts gets.split.map(&:to_i).sort.reverse.join(" ")
|
[["+", 0, 652, 3, 4, 0, 652, 486, 652, 735, 22], ["+", 0, 493, 0, 652, 3, 4, 0, 652, 17, 131]]
| 4
| 19
|
p gets.split.map(&:to_i).sort{|a,b| b<=>a}.join(" ")
|
puts gets.split.map(&:to_i).sort{|a,b| b<=>a}.join(" ")
|
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
| 4
| 29
|
str = STDIN.gets
nums = str.split(" ")
nums.map(&:to_i)
nums = nums.sort {|a, b| b <=> a }
puts nums.join(" ")
|
str = STDIN.gets
nums = str.split(" ")
nums.map!(&:to_i)
nums = nums.sort {|a, b| b <=> a }
puts nums.join(" ")
|
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
| 4
| 46
|
while gets
a = $_.split(" ").map{|val| val.to_i}
a.sort!
for i in 0...a.size
print " " if i != 0
print a[i]
end
puts
end
|
while gets
a = $_.split(" ").map{|val| val.to_i}
a.sort!.reverse!
for i in 0...a.size
print " " if i != 0
print a[i]
end
puts
end
|
[["+", 0, 493, 0, 89, 8, 170, 0, 652, 17, 131], ["+", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22]]
| 4
| 49
|
#encoding: utf-8
arr = gets.rstrip.split(/\s/).map(&:to_i)
arr = arr.sort
puts arr.join(" ")
|
#encoding: utf-8
arr = gets.rstrip.split(/\s/).map(&:to_i)
arr = arr.sort.reverse
puts arr.join(" ")
|
[["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
| 4
| 33
|
n = list(map(int, input().split()))
n.sort(revers=True)
for i in n:
print(i, end=' ')
|
n = list(map(int, input().split()))
n.sort(reverse=True)
for i in n:
print(i, end=' ')
|
[["-", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22]]
| 5
| 40
|
while True:
try:
print("%d %d %d %d %d" % tuple(sorted(list(map(eval,input().split())))))
except EOFError: break
|
while True:
try:
print("%d %d %d %d %d" % tuple(sorted(list(map(eval,input().split())),reverse=True)))
except EOFError: break
|
[["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 3, 4, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 3, 4, 0, 652, 3, 4, 0, 653, 51, 146]]
| 5
| 37
|
l = list(map(int, input().split))
l.sort()
l.reverse()
sl = list(map(str, l))
print(" ".join(sl))
|
l = list(map(int, input().split()))
l.sort()
l.reverse()
sl = list(map(str, l))
print(" ".join(sl))
|
[["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
| 5
| 47
|
nums = list(map(int, input().split()))
nums_sort = sorted(nums)
ans = " ".join(map(str,nums_sort))
print(ans)
|
#! -*- coding:utf-8 -*-
nums = list(map(int, input().split()))
nums_sort = sorted(nums,reverse=True)
ans = " ".join(map(str,nums_sort))
print(ans)
|
[["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 662, 12, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 662, 12, 652, 3, 4, 0, 653, 51, 146]]
| 5
| 42
|
x = sorted(map(int, input().split(" ")))
for i in range(5):
print(x[i], end=' ')
|
x = sorted(map(int, input().split(" ")))
for i in range(5):
print(x[4-i], end=' ')
|
[["+", 0, 652, 3, 4, 0, 206, 206, 657, 31, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 17, 33]]
| 5
| 41
|
print(' '.join(map(str, reversed(sorted(input().split())))))
|
print(' '.join(map(str, reversed(sorted(map(int, input().split()))))))
|
[["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
| 5
| 28
|
a=sorted([int(i) for i in input().split()],reverse=True)
print(",".join(a))
|
a=sorted([int(i) for i in input().split()],reverse=True)
print(" ".join(map(str,a)))
|
[["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 6], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 6], ["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
| 5
| 36
|
print(*sorted(list(map(int, input().split()))[::-1]))
|
print(*sorted(list(map(int, input().split())))[::-1])
|
[["+", 3, 4, 0, 206, 51, 652, 3, 4, 0, 25], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
| 5
| 28
|
print(*sorted(map(int, input().spilt()))[::-1])
|
print(*sorted(map(int, input().split()))[::-1])
|
[["-", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22]]
| 5
| 25
|
a = [int(temp) for temp in input().split()]
a.sort
a = [str(temp) for temp in a]
print(' '.join(a))
|
a = [int(temp) for temp in input().split()]
a.sort(reverse = True)
a = [str(temp) for temp in a]
print(' '.join(a))
|
[["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 51, 146], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
| 5
| 44
|
# -*- coding:utf-8 -*-
a=list(map(int,input().split(" ")))
a.sort(reverse=True)
for val in a:
print(val)
|
# -*- coding:utf-8 -*-
a=list(map(int,input().split(" ")))
a.sort(reverse=True)
for val in a:
print(val, end=' ')
|
[["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 655]]
| 5
| 38
|
print(*reversed(list(map(int,input().split()))))
|
print(*reversed(sorted(map(int,input().split()))))
|
[["-", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22]]
| 5
| 22
|
'''
Created on Mar 22, 2013
@author: wukc
'''
from sys import stdin
a=sorted(map(int,stdin.readline().split()))
print((" ".join(a[::-1])))
|
'''
Created on Mar 22, 2013
@author: wukc
'''
from sys import stdin
a=sorted(map(int,stdin.readline().split()))
print((" ".join(map(str,a[::-1]))))
|
[["+", 0, 23, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
| 5
| 45
|
print(' '.join(map(str, sorted(map(int, input().split())))))
|
print(' '.join(map(str, sorted(map(int, input().split()), reverse=True))))
|
[["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 3, 4, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 3, 4, 0, 652, 3, 4, 0, 653, 51, 146]]
| 5
| 30
|
for (s = 1, i = require("fs").readFileSync("/dev/stdin", "utf8"); i--;)
s *= i;
console.log(i)
|
for (s = i = require("fs").readFileSync("/dev/stdin", "utf8"); --i;)
s *= i;
console.log(s)
|
[["-", 0, 7, 10, 1, 0, 563, 31, 11, 12, 555], ["-", 0, 493, 0, 7, 10, 1, 0, 563, 0, 21], ["-", 0, 493, 0, 7, 15, 1, 0, 27, 28, 22], ["+", 0, 493, 0, 7, 15, 1, 0, 27, 28, 22], ["-", 0, 493, 0, 1, 0, 2, 3, 3, 0, 22], ["+", 0, 493, 0, 1, 0, 2, 3, 3, 0, 22]]
| 2
| 40
|
var input = parseInt(require("fs").readFileSync("/dev/stdin", "utf8").trim());
var ans = 1;
for (var i = 1; i < input; i++) {
ans *= i;
}
console.log(ans);
|
var input = parseInt(require("fs").readFileSync("/dev/stdin", "utf8").trim());
var ans = 1;
for (var i = 1; i <= input; i++) {
ans *= i;
}
console.log(ans);
|
[["-", 0, 493, 0, 7, 15, 1, 0, 16, 17, 18], ["+", 0, 493, 0, 7, 15, 1, 0, 16, 17, 19]]
| 2
| 60
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int answer = 1;
for (int i = 1; i <= num; i++) {
answer = answer * i;
}
System.out.println(answer);
}
}
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
long answer = 1;
for (int i = 1; i <= num; i++) {
answer = answer * i;
}
System.out.println(answer);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 80
|
import java.util.Scanner;
class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
int num, fact = 1;
num = scan.nextInt();
while (num > 1) {
fact *= num;
num--;
}
System.out.println(fact);
}
}
|
import java.util.Scanner;
class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
long num, fact = 1;
num = scan.nextInt();
while (num > 1) {
fact *= num;
num--;
}
System.out.println(fact);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 73
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int ans = 1;
for (int i = 2; i <= n; i++) {
ans *= i;
}
System.out.println(ans);
}
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long ans = 1;
for (int i = 2; i <= n; i++) {
ans *= i;
}
System.out.println(ans);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 78
|
import java.util.Scanner;
public class Main {
public static void main(String[] argv) {
int a = 1;
for (int n = (new Scanner(System.in)).nextInt(); n > 0; a *= n--)
;
System.out.println(a);
}
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] argv) {
long a = 1L;
for (int n = (new Scanner(System.in)).nextInt(); n > 0; a *= n--)
;
System.out.println(a);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499]]
| 3
| 67
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader =
new BufferedReader(new InputStreamReader(System.in));
String readStr;
int n = Integer.parseInt(reader.readLine());
for (int i = n - 1; i > 1; i--) {
n *= i;
}
System.out.println(n);
}
}
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader =
new BufferedReader(new InputStreamReader(System.in));
String readStr;
long n = Integer.parseInt(reader.readLine());
for (long i = n - 1; i > 1; i--) {
n *= i;
}
System.out.println(n);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 8, 196, 0, 7, 502, 503, 39, 506, 0, 507], ["+", 8, 196, 0, 7, 502, 503, 39, 506, 0, 96]]
| 3
| 103
|
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int n = stdIn.nextInt();
int ans = 1;
for (int i = n; i > 0; i--) {
ans *= i;
}
System.out.println(ans);
}
}
|
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int n = stdIn.nextInt();
long ans = 1;
for (int i = n; i > 0; i--) {
ans *= i;
}
System.out.println(ans);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 106
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
System.out.println(factorial(num));
}
public static int factorial(int n) {
int fact = 1;
if (n == 0)
return fact;
else {
for (int i = n; i > 0; i--)
fact = fact * i;
return fact;
}
}
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long num = sc.nextInt();
System.out.println(factorial(num));
}
public static long factorial(long n) {
long fact = 1;
if (n == 0)
return fact;
else {
for (long i = n; i > 0; i--)
fact = fact * i;
return fact;
}
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96], ["-", 0, 195, 54, 495, 0, 496, 39, 506, 0, 507], ["+", 0, 195, 54, 495, 0, 496, 39, 506, 0, 96], ["-", 75, 196, 0, 7, 502, 503, 39, 506, 0, 507], ["+", 75, 196, 0, 7, 502, 503, 39, 506, 0, 96]]
| 3
| 106
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
int x = Integer.parseInt(br.readLine());
int factorial = 1;
for (int i = 1; i <= x; i++) {
factorial *= i;
}
System.out.println(factorial);
} finally {
br.close();
}
}
}
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
int x = Integer.parseInt(br.readLine());
long factorial = 1;
for (int i = 1; i <= x; i++) {
factorial *= i;
}
System.out.println(factorial);
} finally {
br.close();
}
}
}
|
[["-", 0, 246, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 246, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 114
|
import java.util.*;
class Main {
public static void main(String[] agrs) {
Scanner sc = new Scanner(System.in);
while (sc.hasNextInt()) {
int n = sc.nextInt();
int a[] = new int[n];
int b = 0, c = 1;
for (int i = 0; i < a.length; i++) {
a[i] = n - b;
b++;
}
for (int j = 0; j < a.length; j++) {
c *= a[j];
}
System.out.println(c);
}
}
}
|
import java.util.*;
class Main {
public static void main(String[] agrs) {
Scanner sc = new Scanner(System.in);
while (sc.hasNextInt()) {
int n = sc.nextInt();
int a[] = new int[n];
int b = 0;
long c = 1;
for (int i = 0; i < a.length; i++) {
a[i] = n - b;
b++;
}
for (int j = 0; j < a.length; j++) {
c *= a[j];
}
System.out.println(c);
}
}
}
|
[["-", 8, 196, 0, 52, 8, 196, 0, 503, 0, 21], ["+", 8, 196, 0, 52, 8, 196, 0, 503, 0, 35], ["+", 0, 52, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 137
|
import java.io.*;
import java.util.*;
class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int ans = sub(n);
System.out.println(ans);
}
public static int sub(int n) {
if (n > 0) {
return n * sub(n - 1);
} else {
return 1;
}
}
}
|
import java.io.*;
import java.util.*;
class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
long n = scan.nextInt();
long ans = sub(n);
System.out.println(ans);
}
public static long sub(long n) {
if (n > 0) {
return n * sub(n - 1);
} else {
return 1;
}
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96], ["-", 0, 195, 54, 495, 0, 496, 39, 506, 0, 507], ["+", 0, 195, 54, 495, 0, 496, 39, 506, 0, 96]]
| 3
| 101
|
import java.io.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
while ((str = br.readLine()) != null) {
int x = Integer.parseInt(str);
System.out.println(fact(x));
}
}
private static int fact(int x) {
if (x == 0) {
return 1;
}
return x * fact(x - 1);
}
}
|
import java.io.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
while ((str = br.readLine()) != null) {
int x = Integer.parseInt(str);
System.out.println(fact(x));
}
}
private static long fact(int x) {
if (x == 0) {
return 1;
}
return x * fact(x - 1);
}
}
|
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96]]
| 3
| 112
|
import java.io.*;
import java.lang.*;
import java.util.*;
public class Main {
public static void main(String[] arg) throws IOException {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
String line;
line = input.readLine();
int a = Integer.parseInt(line);
int sum = 1;
for (int i = 1; i <= a; i++) {
sum *= i;
}
System.out.println(sum);
}
}
|
import java.io.*;
import java.lang.*;
import java.util.*;
public class Main {
public static void main(String[] arg) throws IOException {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
String line;
line = input.readLine();
int a = Integer.parseInt(line);
long sum = 1;
for (int i = 1; i <= a; i++) {
sum *= i;
}
System.out.println(sum);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 110
|
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String nst = br.readLine();
int n = Integer.parseInt(nst);
int fact = 1;
for (int i = 1; i <= n; i++)
fact *= i;
System.out.println(fact);
}
}
|
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String nst = br.readLine();
int n = Integer.parseInt(nst);
long fact = 1;
for (int i = 1; i <= n; i++)
fact *= i;
System.out.println(fact);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 97
|
import java.util.Scanner;
class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
while (sc.hasNext()) {
int n = sc.nextInt();
System.out.println(answar(n));
}
}
static int answar(int n) {
int ans = 1;
for (int i = 1; i <= n; i++) {
ans *= i;
}
return ans;
}
}
|
import java.util.Scanner;
class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
while (sc.hasNext()) {
int n = sc.nextInt();
System.out.println(answar(n));
}
}
static long answar(int n) {
long ans = 1;
for (int i = 1; i <= n; i++) {
ans *= i;
}
return ans;
}
}
|
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96], ["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 103
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource") Scanner sc = new Scanner(System.in);
int inputNum = sc.nextInt();
if (inputNum != 0) {
for (int i = inputNum; i > 1; i--) {
inputNum *= (i - 1);
}
System.out.println(inputNum);
} else {
System.out.println(1);
}
}
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource") Scanner sc = new Scanner(System.in);
long inputNum = sc.nextInt();
if (inputNum != 0) {
for (int i = (int)inputNum; i > 1; i--) {
inputNum *= (i - 1);
}
System.out.println(inputNum);
} else {
System.out.println(1);
}
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["+", 0, 7, 502, 503, 49, 200, 51, 74, 0, 24], ["+", 502, 503, 49, 200, 51, 74, 39, 506, 0, 507], ["+", 0, 7, 502, 503, 49, 200, 51, 74, 0, 25]]
| 3
| 104
|
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
int a = 1;
for (; i > 0; i--) {
a *= i;
}
System.out.println(a);
}
}
|
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
long i = sc.nextLong();
long a = 1;
for (; i > 0; i--) {
a *= i;
}
System.out.println(a);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22]]
| 3
| 74
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
static InputReader in;
static PrintWriter out;
static class Solution {
void solve() throws IOException {
int n = in.nextInt();
out.println(factorial(n));
// End solve()
}
int factorial(int x) {
int factorial = x;
if (x == 0) {
return 1;
} else {
factorial *= factorial(x - 1);
}
return factorial;
}
// End Solution
}
public static void main(String[] args) throws IOException {
in = new InputReader(System.in);
out = new PrintWriter(System.out);
Solution solver = new Solution();
solver.solve();
out.close();
}
static class InputReader {
public BufferedReader br;
public StringTokenizer st;
public InputReader(InputStream stream) {
br = new BufferedReader(new InputStreamReader(stream));
}
public int nextInt() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Integer.parseInt(st.nextToken());
}
public long nextLong() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Long.parseLong(st.nextToken());
}
public String next() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return st.nextToken();
}
public double nextDouble() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Double.parseDouble(st.nextToken());
}
}
}
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
static InputReader in;
static PrintWriter out;
static class Solution {
void solve() throws IOException {
int n = in.nextInt();
out.println(factorial(n));
// End solve()
}
long factorial(int x) {
long factorial = x;
if (x == 0) {
return 1;
} else {
factorial *= factorial(x - 1);
}
return factorial;
}
// End Solution
}
public static void main(String[] args) throws IOException {
in = new InputReader(System.in);
out = new PrintWriter(System.out);
Solution solver = new Solution();
solver.solve();
out.close();
}
static class InputReader {
public BufferedReader br;
public StringTokenizer st;
public InputReader(InputStream stream) {
br = new BufferedReader(new InputStreamReader(stream));
}
public int nextInt() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Integer.parseInt(st.nextToken());
}
public long nextLong() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Long.parseLong(st.nextToken());
}
public String next() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return st.nextToken();
}
public double nextDouble() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Double.parseDouble(st.nextToken());
}
}
}
|
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96], ["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 409
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) { print(); }
public static void print() {
try {
int answer = 1;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
int num = Integer.parseInt(str);
for (int i = 0; i < num; i++) {
answer = answer * (i + 1);
}
System.out.println(answer);
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) { print(); }
public static void print() {
try {
long answer = 1;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
int num = Integer.parseInt(str);
for (int i = 0; i < num; i++) {
answer = answer * (i + 1);
}
System.out.println(answer);
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
[["-", 0, 246, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 246, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 140
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
try {
// Input
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
int num, fact;
while ((str = br.readLine()) != null) {
num = Integer.parseInt(str);
fact = 1;
for (int i = 1; i <= num; i++) {
fact = fact * i;
}
System.out.println(fact);
}
// Output
} catch (Exception e) {
System.out.println("error");
}
}
}
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
try {
// Input
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
int num;
long fact;
while ((str = br.readLine()) != null) {
num = Integer.parseInt(str);
fact = 1;
for (int i = 1; i <= num; i++) {
fact = fact * i;
}
System.out.println(fact);
}
// Output
} catch (Exception e) {
System.out.println("error");
}
}
}
|
[["-", 8, 196, 0, 246, 8, 196, 0, 503, 0, 21], ["+", 8, 196, 0, 246, 8, 196, 0, 503, 0, 35], ["+", 0, 246, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 137
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.println(func(n));
}
public static int func(int n) {
if (n == 1)
return 1;
return n * func(n - 1);
}
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.println(func(n));
}
public static long func(int n) {
if (n == 1)
return 1;
return n * func(n - 1);
}
}
|
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96]]
| 3
| 86
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = Integer.parseInt(scan.nextLine());
int factorial = 1;
for (int i = n; i > 0; i--) {
factorial *= i;
}
System.out.println(factorial);
}
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = Integer.parseInt(scan.nextLine());
long factorial = 1;
for (int i = n; i > 0; i--) {
factorial *= i;
}
System.out.println(factorial);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 83
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args)
throws NumberFormatException, IOException {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
int result = 1;
for (int i = 1; i <= N; i++) {
result *= i;
}
System.out.println(result);
}
}
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args)
throws NumberFormatException, IOException {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
long result = 1;
for (int i = 1; i <= N; i++) {
result *= i;
}
System.out.println(result);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 106
|
import java.io.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
int answer = 1;
BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
String s = buf.readLine();
int n = Integer.parseInt(s);
for (int i = 1; i <= n; i++) {
answer = answer * i;
}
System.out.println(answer);
}
}
|
import java.io.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
long answer = 1;
BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
String s = buf.readLine();
long n = Integer.parseInt(s);
for (int i = 1; i <= n; i++) {
answer = answer * i;
}
System.out.println(answer);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 111
|
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
System.out.println(factorial(n));
}
public static int factorial(int n) {
return n == 0 ? 1 : n * factorial(n - 1);
}
}
|
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
System.out.println(factorial(n));
}
public static long factorial(int n) {
return n == 0 ? 1 : n * factorial(n - 1);
}
}
|
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96]]
| 3
| 81
|
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int number = in.nextInt();
int factorial = number;
for (int i = 1; i < number; i++) {
factorial = factorial * (number - i);
}
System.out.println(factorial);
}
}
|
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int number = in.nextInt();
long factorial = number;
for (int i = 1; i < number; i++) {
factorial = factorial * (number - i);
}
System.out.println(factorial);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 83
|
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int su;
su = sc.nextInt();
int kei = 1;
for (int i = 1; i <= su; i++) {
kei = kei * i;
}
System.out.println(kei);
}
}
|
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int su;
su = sc.nextInt();
long kei = 1;
for (int i = 1; i <= su; i++) {
kei = kei * i;
}
System.out.println(kei);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 81
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int ans = 1;
for (int i = n; i > 0; i--) {
ans *= i;
}
System.out.println(ans);
}
}
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
long ans = 1;
for (int i = n; i > 0; i--) {
ans *= i;
}
System.out.println(ans);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 117
|
import java.io.*;
import java.util.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
System.out.println(fun(n));
}
static int fun(int n) { return (n == 0) ? 1 : n * fun(n - 1); }
}
|
import java.io.*;
import java.util.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
System.out.println(fun(n));
}
static long fun(int n) { return (n == 0) ? 1 : n * fun(n - 1); }
}
|
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96]]
| 3
| 100
|
import java.util.Arrays;
import java.util.Scanner;
public class Main {
private Scanner sc;
public static void main(String[] args) { new Main(); }
public Main() {
sc = new Scanner(System.in);
while (sc.hasNextLine() == true) {
int nico = Integer.parseInt(sc.nextLine());
int ans = 1;
for (int i = 0; i < nico; i++) {
ans = ans * (i + 1);
}
System.out.println(ans);
}
}
}
|
import java.util.Arrays;
import java.util.Scanner;
public class Main {
private Scanner sc;
public static void main(String[] args) { new Main(); }
public Main() {
sc = new Scanner(System.in);
while (sc.hasNextLine() == true) {
int nico = Integer.parseInt(sc.nextLine());
long ans = 1;
for (int i = 0; i < nico; i++) {
ans = ans * (i + 1);
}
System.out.println(ans);
}
}
}
|
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 122
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(br.readLine());
int result = fact(a);
System.out.println(result);
}
private static int fact(int x) {
if (x == 1)
return 1;
else
return x * fact(x - 1);
}
}
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(br.readLine());
long result = fact(a);
System.out.println(result);
}
private static long fact(int x) {
if (x == 1)
return 1;
else
return x * fact(x - 1);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96]]
| 3
| 116
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
System.out.println(fact(n));
}
private static int fact(int n) {
if (n == 0)
return 1;
return n * fact(n - 1);
}
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
System.out.println(fact(n));
}
private static long fact(int n) {
if (n == 0)
return 1;
return n * fact(n - 1);
}
}
|
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96]]
| 3
| 90
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String[] args)
throws NumberFormatException, IOException {
String strLine = "";
BufferedReader stdReader =
new BufferedReader(new InputStreamReader(System.in));
int MAX_DETASET = 20;
int cnt = 0;
ArrayList<String> list = new ArrayList<String>();
if ((strLine = stdReader.readLine()) != null) {
//??°????????????
int intStrLine = Integer.parseInt(strLine);
int k = intStrLine;
for (int i = intStrLine - 1; i > 0; i--) {
k = k * i;
}
System.out.println(k);
}
}
}
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String[] args)
throws NumberFormatException, IOException {
String strLine = "";
BufferedReader stdReader =
new BufferedReader(new InputStreamReader(System.in));
int MAX_DETASET = 20;
int cnt = 0;
ArrayList<String> list = new ArrayList<String>();
if ((strLine = stdReader.readLine()) != null) {
//??°????????????
long intStrLine = Integer.parseInt(strLine);
long k = intStrLine;
for (long i = intStrLine - 1; i > 0; i--) {
k = k * i;
}
System.out.println(k);
}
}
}
|
[["-", 0, 57, 64, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 57, 64, 196, 0, 503, 39, 506, 0, 96], ["-", 64, 196, 0, 7, 502, 503, 39, 506, 0, 507], ["+", 64, 196, 0, 7, 502, 503, 39, 506, 0, 96]]
| 3
| 159
|
public class Main {
static int n = new java.util.Scanner(System.in).nextInt();
public static void main(String[] args) {
int ans = 1;
for (int i = 1; i <= n; i++) {
ans = ans * i;
}
System.out.println(ans);
}
}
|
public class Main {
static int n = new java.util.Scanner(System.in).nextInt();
public static void main(String[] args) {
long ans = 1;
for (int i = 1; i <= n; i++) {
ans = ans * i;
}
System.out.println(ans);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 73
|
import java.util.Scanner;
class Main {
public static void main(String[] a) {
Scanner sc = new Scanner(System.in);
int suuji[] = new int[20];
for (int i = 1; i < 21; i++) {
suuji[i - 1] = i;
}
int n = sc.nextInt();
int ans = 1;
for (int i = n; i > 0; i--) {
ans = ans * suuji[i - 1];
}
System.out.println(ans);
}
}
|
import java.util.Scanner;
class Main {
public static void main(String[] a) {
Scanner sc = new Scanner(System.in);
int suuji[] = new int[20];
for (int i = 1; i < 21; i++) {
suuji[i - 1] = i;
}
int n = sc.nextInt();
long ans = 1;
for (int i = n; i > 0; i--) {
ans = ans * suuji[i - 1];
}
System.out.println(ans);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 120
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
int n = Integer.parseInt(str);
System.out.println(math(n));
}
static int math(int n) {
for (int i = n; 1 < i; i--) {
if (i == 0) {
break;
}
n *= (i - 1);
}
return n;
}
}
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
long n = Integer.parseInt(str);
System.out.println(math(n));
}
static long math(long n) {
for (long i = n; 1 < i; i--) {
if (i == 0) {
break;
}
n *= (i - 1);
}
return n;
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96], ["-", 0, 195, 54, 495, 0, 496, 39, 506, 0, 507], ["+", 0, 195, 54, 495, 0, 496, 39, 506, 0, 96], ["-", 8, 196, 0, 7, 502, 503, 39, 506, 0, 507], ["+", 8, 196, 0, 7, 502, 503, 39, 506, 0, 96]]
| 3
| 132
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = Integer.parseInt(sc.next());
System.out.println(calc(num));
sc.close();
}
static int calc(int num) {
if (num == 1) {
return num;
} else {
return num * calc(num - 1);
}
}
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = Integer.parseInt(sc.next());
System.out.println(calc(num));
sc.close();
}
static long calc(int num) {
if (num == 1) {
return num;
} else {
return num * calc(num - 1);
}
}
}
|
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96]]
| 3
| 100
|
import java.lang.*;
import java.math.*;
import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
int rep(int n) {
if (n == 0) {
return 1;
} else {
return rep(n - 1) * n;
}
}
void run() {
int n = sc.nextInt();
System.out.println(rep(n));
}
public static void main(String[] args) {
Main m = new Main();
m.run();
}
}
|
import java.lang.*;
import java.math.*;
import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
long rep(long n) {
if (n == 0) {
return 1;
} else {
return rep(n - 1) * n;
}
}
void run() {
int n = sc.nextInt();
System.out.println(rep(n));
}
public static void main(String[] args) {
Main m = new Main();
m.run();
}
}
|
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96], ["-", 0, 195, 54, 495, 0, 496, 39, 506, 0, 507], ["+", 0, 195, 54, 495, 0, 496, 39, 506, 0, 96]]
| 3
| 122
|
import java.util.Scanner;
public class Main {
public static void main(String[] a) {
Scanner s = new Scanner(System.in);
int n = s.nextInt(), i, f = 1;
for (i = 1; i <= n; i++)
f = f * i;
System.out.println(f);
}
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] a) {
Scanner s = new Scanner(System.in);
int n = s.nextInt(), i;
long f = 1;
for (i = 1; i <= n; i++)
f = f * i;
System.out.println(f);
}
}
|
[["-", 8, 498, 0, 195, 8, 196, 0, 503, 0, 21], ["+", 8, 498, 0, 195, 8, 196, 0, 503, 0, 35], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 78
|
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.close();
int p = 1;
while (n > 1) {
p *= n--;
}
System.out.println(p);
}
}
|
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.close();
long p = 1;
while (n > 1) {
p *= n--;
}
System.out.println(p);
}
}
|
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 76
|
import java.io.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String s;
int i, n, c = 1;
try {
s = r.readLine();
n = Integer.parseInt(s);
for (i = 1; i <= n; i++)
c *= i;
System.out.println(c);
} catch (Exception err) {
System.exit(0);
}
}
}
|
import java.io.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String s;
int i, n;
long c = 1;
try {
s = r.readLine();
n = Integer.parseInt(s);
for (i = 1; i <= n; i++)
c *= i;
System.out.println(c);
} catch (Exception err) {
System.exit(0);
}
}
}
|
[["-", 8, 498, 0, 195, 8, 196, 0, 503, 0, 21], ["+", 8, 498, 0, 195, 8, 196, 0, 503, 0, 35], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
| 3
| 112
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println(kaijo(scan.nextInt()));
}
private static int kaijo(int n) {
if (n == 0) {
return 1;
} else {
return n * kaijo(n - 1);
}
}
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println(kaijo(scan.nextLong()));
}
private static long kaijo(long n) {
if (n == 0) {
return 1;
} else {
return n * kaijo(n - 1);
}
}
}
|
[["-", 3, 4, 0, 492, 3, 4, 0, 492, 141, 22], ["+", 3, 4, 0, 492, 3, 4, 0, 492, 141, 22], ["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96], ["-", 0, 195, 54, 495, 0, 496, 39, 506, 0, 507], ["+", 0, 195, 54, 495, 0, 496, 39, 506, 0, 96]]
| 3
| 85
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNext())
System.out.println(f(in.nextInt()));
}
static int f(int v) { return (v == 1) ? 1 : f(v - 1) * v; }
}
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNext())
System.out.println(f(in.nextInt()));
}
static long f(long v) { return (v == 1) ? 1 : f(v - 1) * v; }
}
|
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96], ["-", 0, 195, 54, 495, 0, 496, 39, 506, 0, 507], ["+", 0, 195, 54, 495, 0, 496, 39, 506, 0, 96]]
| 3
| 86
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.