submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s903885905
|
p00016
|
C++
|
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
#define pi 3.14
int main()
{
int x = 0, y = 0;
double d = 0, a = 90, r = 360;
while (d != 0 || r != 0) {
scanf_s("%lf,%lf", &d, &r);
x = x + d * cos(a / 360 * 2 * pi);
y = y + d * sin(a / 360 * 2 * pi);
a = a + r;
}
cout << x << endl << y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
13 | scanf_s("%lf,%lf", &d, &r);
| ^~~~~~~
| scanf
|
s641659060
|
p00016
|
C++
|
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>a
#include<cmath>
using namespace std;
#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)
#define X real()
#define Y imag()
typedef complex<double> P;
const double EPS = 0.000000001;
int main(){
int a,b;
double angle = M_PI/2;
P pos = P(0,0);
while(scanf("%d,%d",&a,&b)){
if(a==0 && b==0)break;
pos += P(cos(angle),sin(angle))*(double)a;
angle -= b/180.0*M_PI;
}
printf("%d %d\n",int(pos.X-0.5+EPS),int(pos.Y-0.5+EPS));
}
|
a.cc:10:9: fatal error: stack>: No such file or directory
10 | #include<stack>a
| ^~~~~~~~
compilation terminated.
|
s890075237
|
p00016
|
C++
|
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
#include <stack>
#include <math.h>
using namespace std;
typedef long long Int;
#define REP(i , x) for(Int i = 0 ; i < x ; ++i)
typedef pair<int, int> P;
int main()
{
int a, b;
double x = 0;
double y = 0;
int radius = 0;
while (scanf_s("%d,%d", &a, &b), a&&b){
y += a*sin(radius*M_PI/180);
x += a*cos(radius*M_PI/180);
radius += b;
}
y *= 10;
y %= 10;
y /= 10;
x *= 10;
x %= 10;
x /= 10;
cout << (int)y << endl << (int)x << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:30:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
30 | while (scanf_s("%d,%d", &a, &b), a&&b){
| ^~~~~~~
| scanf
a.cc:36:11: error: invalid operands of types 'double' and 'int' to binary 'operator%'
36 | y %= 10;
| ~~^~~~~
a.cc:36:11: note: in evaluation of 'operator%=(double, int)'
a.cc:40:11: error: invalid operands of types 'double' and 'int' to binary 'operator%'
40 | x %= 10;
| ~~^~~~~
a.cc:40:11: note: in evaluation of 'operator%=(double, int)'
|
s345860087
|
p00016
|
C++
|
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
#include <stack>
#include <math.h>
using namespace std;
typedef long long Int;
#define REP(i , x) for(Int i = 0 ; i < x ; ++i)
typedef pair<int, int> P;
int main()
{
int a, b;
double x = 0;
double y = 0;
int radius = 0;
while (scanf("%d,%d", &a, &b), a&&b){
y += a*sin(radius*M_PI/180);
x += a*cos(radius*M_PI/180);
radius += b;
}
y *= 10;
y %= 10;
y /= 10;
x *= 10;
x %= 10;
x /= 10;
cout << (int)y << endl << (int)x << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:36:11: error: invalid operands of types 'double' and 'int' to binary 'operator%'
36 | y %= 10;
| ~~^~~~~
a.cc:36:11: note: in evaluation of 'operator%=(double, int)'
a.cc:40:11: error: invalid operands of types 'double' and 'int' to binary 'operator%'
40 | x %= 10;
| ~~^~~~~
a.cc:40:11: note: in evaluation of 'operator%=(double, int)'
|
s806155866
|
p00016
|
C++
|
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
#include <stack>
#include <math.h>
using namespace std;
typedef long long Int;
#define REP(i , x) for(Int i = 0 ; i < x ; ++i)
typedef pair<int, int> P;
int main()
{
int a, b;
double x = 0;
double y = 0;
int radius = 0;
while (scanf("%d,%d", &a, &b), a&&b){
y += a*sin(radius*M_PI/180);
x += a*cos(radius*M_PI/180);
radius += b;
}
y *= 10;
int y_ = y;
y_ %= 10;
y_ /= 10;
x *= 10;
int x_ x;
x_ %= 10;
x_ /= 10;
cout << (int)y_ << endl << (int)x_ << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:41:16: error: expected initializer before 'x'
41 | int x_ x;
| ^
a.cc:42:9: error: 'x_' was not declared in this scope; did you mean 'y_'?
42 | x_ %= 10;
| ^~
| y_
|
s647051542
|
p00016
|
C++
|
#include <iostream>
#include <math.h>
#include <stdlib>
using namespace std;
#define PI 3.14159265
int main()
{
double x=0,y=0;
int r,dth,th=0;
while(true){
scanf("%d,%d",&r,&dth);
if(!r&&!dth)break;
x+=r*sin((double)th*PI/180);
y+=r*cos((double)th*PI/180);
th+=dth;
}
cout<<int(x)<<endl;
cout<<int(y)<<endl;
return 0;
}
|
a.cc:3:10: fatal error: stdlib: No such file or directory
3 | #include <stdlib>
| ^~~~~~~~
compilation terminated.
|
s406058437
|
p00016
|
C++
|
#include <iostream>
#include <math.h>
#include <stdlib>
#include <cstdio>
using namespace std;
#define PI 3.14159265
int main()
{
double x=0,y=0;
int r,dth,th=0;
while(true){
scanf("%d,%d",&r,&dth);
if(!r&&!dth)break;
x+=r*sin((double)th*PI/180);
y+=r*cos((double)th*PI/180);
th+=dth;
}
cout<<int(x)<<endl;
cout<<int(y)<<endl;
return 0;
}
|
a.cc:3:10: fatal error: stdlib: No such file or directory
3 | #include <stdlib>
| ^~~~~~~~
compilation terminated.
|
s981282132
|
p00016
|
C++
|
//
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <array>
#include <numeric>
#include <functional>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<utility>
#include<complex>
using namespace std;
#define REP(i,m,n) for(int i=m;i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define ALL(x) (x).begin(),(x).end()
typedef long long ll;
typedef pair<int, int> pii;
const ll inf = INT_MAX;
const double eps = 1e-10;
const double pi = acos(-1.0);
const int di[][2] = {{1,0},{0,1},{-1,0},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}};
int main(){
int r;
double x=0, y=0;
double ini = pi/2, alpha, theta;
cout << endl;
while(scanf("%d,%lf\n", &r, &theta)){
if(r == 0 && std::abs(theta - 0.0) < eps){
// printf("finished\n");
break;
}
else{
x += r*cos(ini);
y += r*sin(ini);
alpha = pi*theta/180;
ini -= alpha;
}
}
printf("%d %d\n", (int)x, (int)y);
return 0;
}
|
a.cc:29:16: error: 'INT_MAX' was not declared in this scope
29 | const ll inf = INT_MAX;
| ^~~~~~~
a.cc:19:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
18 | #include<complex>
+++ |+#include <climits>
19 |
|
s466487140
|
p00016
|
C++
|
import sys
import itertools
import math
curdeg = 0
xstep = 0
ystep = 0
for line in sys.stdin.readlines():
step, deg = map(int, line.split(","))
xstep += step * math.cos(math.pi * curdeg / 180)
ystep += step * math.sin(math.pi * curdeg / 180)
curdeg += deg
print("{:.0f}".format(ystep))
print("{:.0f}".format(xstep))
|
a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s935027006
|
p00016
|
C++
|
#include<iostream>
#include<cmath>
#difine PI 3.14159265359
using namespace std;
int main(){
int d, a = 90, a2;
double x,y;
char c;
while(cin >> d >> c >> a2){
if(d == 0 && a == 0) break;
double rad = a * (PI / 180);
x += d * cos(rad);
y += d * sin(rad);
a += a2;
}
}
cout << (int)x << "\n" << (int)y << endl;
}
|
a.cc:3:2: error: invalid preprocessing directive #difine; did you mean #define?
3 | #difine PI 3.14159265359
| ^~~~~~
| define
a.cc: In function 'int main()':
a.cc:12:23: error: 'PI' was not declared in this scope
12 | double rad = a * (PI / 180);
| ^~
a.cc: At global scope:
a.cc:18:3: error: 'cout' does not name a type
18 | cout << (int)x << "\n" << (int)y << endl;
| ^~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s747457801
|
p00016
|
C++
|
#include<iostream>
#include<cmath>
#define PI 3.14159265359
using namespace std;
int main(){
int d, a = 90, a2;
double x,y;
char c;
while(cin >> d >> c >> a2){
if(d == 0 && a == 0) break;
double rad = a * (PI / 180);
x += d * cos(rad);
y += d * sin(rad);
a += a2;
}
}
cout << (int)x << "\n" << (int)y << endl;
}
|
a.cc:18:3: error: 'cout' does not name a type
18 | cout << (int)x << "\n" << (int)y << endl;
| ^~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s816855883
|
p00016
|
C++
|
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<iomanip>
#include<functional>
using namespace std;
typedef long long llong;
double digrad(double dig) { return dig*M_PI / 180.0; }
int main() {
double d, a,q=90;
double x = 0, y = 0;
char f;
double rad=M_PI*q/180;
while (true) {
cin >> d >> f >> a;
if (d == 0 && a == 0)break;
x += d*cos(digrad(q));
y += d*sin(digrad(q));
????????????//cout << "x: " << x << " y: " << y << endl;
q -= a;
}
x = (int)x;
y = (int)y;
cout << x << endl << y << endl;
return 0;
}
|
a.cc:26:19: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
a.cc: In function 'int main()':
a.cc:26:9: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:10: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:11: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:12: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:13: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:14: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:15: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:16: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:17: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:18: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:19: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:26:20: error: expected primary-expression before '?' token
26 | ????????????//cout << "x: " << x << " y: " << y << endl;
| ^
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
a.cc:27:23: error: expected ':' before ';' token
27 | q -= a;
| ^
| :
a.cc:27:23: error: expected primary-expression before ';' token
|
s043587245
|
p00016
|
C++
|
#include <cstdio>
#include <algorithm>
#include <complex>
using namespace std;
using Point=complex<double>;
static const double PI=3.141592653589793;
int main() {
Point arg=polar(1.0, PI/2);
Point target=0+0i;
while (true) {
double d, a;
scanf("%lf, %lf", &d, &a);
if (d == 0.0 && a == 0.0)
break;
target += d*arg;
arg *= polar(1.0, -a*PI/180);
}
int x=target.real(), y=target.imag();
printf("%d\n", x);
printf("%d\n", y);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:19: error: no match for 'operator+' (operand types are 'int' and 'std::complex<double>')
13 | Point target=0+0i;
| ~^~~
| | |
| | std::complex<double>
| int
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: 'std::complex<double>' is not derived from 'const std::reverse_iterator<_Iterator>'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
1798 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: 'std::complex<double>' is not derived from 'const std::move_iterator<_IteratorL>'
13 | Point target=0+0i;
| ^~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/istream:40,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from a.cc:3:
/usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3616 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'const _CharT*' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3719 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'const _CharT*' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3726 | operator+(_CharT __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)'
3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)'
3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)'
340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed:
a.cc:13:20: note: mismatched types 'const std::complex<_Tp>' and 'int'
13 | Point target=0+0i;
| ^~
/usr/include/c++/14/complex:349:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const
|
s933165950
|
p00016
|
C++
|
#include<iostream>
#include<math.h>
#include<stdio.h>
using namespace std;
int main() {
double sum,x,y,b,c;
int a, d;
a = 0;
x = 0;
y = 0;
sum = 0;
while (scanf_s("%d,%d",&d,&a)) {
if (a == 0 && d == 0) break;
b = (double)a;
c = (double)d;
x += c*cos(sum*3.1416/180);
y += c*sin(sum*3.1416/180);
sum += b;
}
cout << (int)y << " " << (int)x << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
12 | while (scanf_s("%d,%d",&d,&a)) {
| ^~~~~~~
| scanf
|
s089045332
|
p00016
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
cout << fixed << setprecision(0);
ios :: sync_with_stdio(false);
db d, t; char c;
db x, y, a;
while(cin >> d >> c >> t) {
a -= t;
x += d * cos(a);
y += d * sin(a);
}
cout << x << ' ' << y << '\n';
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:9: error: 'db' was not declared in this scope
7 | db d, t; char c;
| ^~
a.cc:8:11: error: expected ';' before 'x'
8 | db x, y, a;
| ^~
| ;
a.cc:9:22: error: 'd' was not declared in this scope
9 | while(cin >> d >> c >> t) {
| ^
a.cc:9:32: error: 't' was not declared in this scope
9 | while(cin >> d >> c >> t) {
| ^
a.cc:10:17: error: 'a' was not declared in this scope
10 | a -= t;
| ^
a.cc:11:17: error: 'x' was not declared in this scope
11 | x += d * cos(a);
| ^
a.cc:12:17: error: 'y' was not declared in this scope
12 | y += d * sin(a);
| ^
a.cc:14:17: error: 'x' was not declared in this scope
14 | cout << x << ' ' << y << '\n';
| ^
a.cc:14:29: error: 'y' was not declared in this scope
14 | cout << x << ' ' << y << '\n';
| ^
|
s220152431
|
p00016
|
C++
|
import Data.List.Split
type Dir = [Double]
type Round = Double
solve :: Round -> Dir -> [Double] -> Dir
solve _ d [] = d
solve r [f,s] (x:y:xs) = solve (y+r) (f+x*sin (pi/180*r) : s+x*cos (pi/180*r):[]) xs
floor' :: Double -> Int
floor' d
| d < 0 = (0-) $ floor $ -d
| otherwise = floor d
main = getContents >>= putStr . unlines . map (show . floor') . solve 0 [0,0] . map read . concat . map (splitOn ",") . lines
|
a.cc:9:6: warning: missing terminating ' character
9 | floor' :: Double -> Int
| ^
a.cc:9:6: error: missing terminating ' character
9 | floor' :: Double -> Int
| ^~~~~~~~~~~~~~~~~~
a.cc:10:6: warning: missing terminating ' character
10 | floor' d
| ^
a.cc:10:6: error: missing terminating ' character
10 | floor' d
| ^~~
a.cc:14:60: warning: missing terminating ' character
14 | main = getContents >>= putStr . unlines . map (show . floor') . solve 0 [0,0] . map read . concat . map (splitOn ",") . lines
| ^
a.cc:14:60: error: missing terminating ' character
14 | main = getContents >>= putStr . unlines . map (show . floor') . solve 0 [0,0] . map read . concat . map (splitOn ",") . lines
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
1 | import Data.List.Split
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s621429472
|
p00016
|
C++
|
#define _USE_MATH_DEFINES
#include <iostream>
#include <stack>
using namespace std;
double rad(int degree){
return (M_PI*degree) / 180;
}
int main(){
double x = 0, y = 0;
int d, dir = 90, a;
char comma;
while (cin >> d >> comma >> a, d || a){
x += d * cos(rad(dir));
y += d * sin(rad(dir));
dir -= a;
}
cout << (int)x << endl;
cout << (int)y << endl;
return 0;
}
|
a.cc: In function 'double rad(int)':
a.cc:8:17: error: 'M_PI' was not declared in this scope
8 | return (M_PI*degree) / 180;
| ^~~~
a.cc: In function 'int main()':
a.cc:18:26: error: 'cos' was not declared in this scope
18 | x += d * cos(rad(dir));
| ^~~
a.cc:19:26: error: 'sin' was not declared in this scope
19 | y += d * sin(rad(dir));
| ^~~
|
s228520299
|
p00016
|
C++
|
/*
C++ ???????????????????????????????????¬??????
??????AOJ-ITP1??????????????????
*/
#define _USE_MATH_DEFINES
#include <iostream> // ?¨??????\??????
#include <fstream> // ??????????????\??????
#include <string> // ???????????¢???
#include <vector> // ???????????????
#include <cmath> // ??°??????
#include <iomanip> // stream???????????¢???
#include <algorithm>// max??¢??°??????
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector; // ????´???°????????????????????????
using std::fixed; // ???????????????????¨???????????????????????????????
using std::setprecision; // ?????°????°???°?????\???????????°????????????????????¨????????\???
int main() {
double d = 0.0; // ????????????????????¢
double a = 0.0; // ?????????????????????
double x = 0.0;
double y = 0.0;
int ak = 90; // ???????????????90????????????
while (true)
{
scanf_s("%lf,%lf", &d, &a); // double?????????????????????%f??§????????????%lf?????????
if (d == 0 && a == 0) { break; }
x += cos(ak*M_PI / 180) * d;
y += sin(ak*M_PI / 180) * d;
ak -= a;
ak %= 360;
}
// ??????
cout << (int)x << "\n" << (int)y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:31:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
31 | scanf_s("%lf,%lf", &d, &a); // double?????????????????????%f??§????????????%lf?????????
| ^~~~~~~
| scanf
|
s658793649
|
p00016
|
C++
|
import math
x = y = n= 0
while True:
d,a = map(int,input().split(','))
if d == a == 0: break
x += d*math.sin(math.radians(n))
y += d*math.cos(math.radians(n))
n+=a
print(*map(int,(x,y)),sep='\n')
|
a.cc:1:1: error: 'import' does not name a type
1 | import math
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s582316564
|
p00016
|
C++
|
#define _USE_MATH_DEFINES
#include<iostream>
int main()
{
double x = 0, y = 0;
int a = 90;
while (true)
{
int di, ai;
char temp;
std::cin >> di >> temp >> ai;
if (di == 0 && ai == 0)
{
break;
}
x += di * cos(a * M_PI / 180);
y += di * sin(a * M_PI / 180);
a -= ai;
}
std::cout << static_cast<int>(floor(x)) << std::endl;
std::cout << static_cast<int>(floor(y)) << std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:35: error: 'M_PI' was not declared in this scope
16 | x += di * cos(a * M_PI / 180);
| ^~~~
a.cc:16:27: error: 'cos' was not declared in this scope
16 | x += di * cos(a * M_PI / 180);
| ^~~
a.cc:17:27: error: 'sin' was not declared in this scope
17 | y += di * sin(a * M_PI / 180);
| ^~~
a.cc:20:39: error: 'floor' was not declared in this scope
20 | std::cout << static_cast<int>(floor(x)) << std::endl;
| ^~~~~
|
s120171862
|
p00016
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#define add push_back
#define inf 2147000000
#define pi 3.1415926535
#define rep(i,n) for(int i=0;i<n;i++)
#define out(a) cout<<a<<endl;
using namespace std;
int main(void){
double x,y,kk=pi/2;
string str;
char* bin;
x=0;y=0;
while(1){
cin>>str;
int t = str.find(',');
string st1 = str.substr(0,t);
string st2 = str.substr(t+1);
double a1,a2;
bin = &st1[0];
a1=atoi(bin);
bin = &st2[0];
a2=atoi(bin);
if(a1==0 && a2==0){
break;
}
x+=cos(kk)*a1;
y+=sin(kk)*a1;
kk-=(double)a2/180*pi;
}
printf("%.0lf\n%.0lf\n",x,y);
}
|
a.cc: In function 'int main()':
a.cc:36:20: error: 'cos' was not declared in this scope
36 | x+=cos(kk)*a1;
| ^~~
a.cc:37:20: error: 'sin' was not declared in this scope; did you mean 'bin'?
37 | y+=sin(kk)*a1;
| ^~~
| bin
|
s814222582
|
p00016
|
C++
|
#include <iostream>
#include <numeric>
#include <cstdlib>
using namespace std;
int main(){
double x = 0.0;
double y = 0.0;
double angle = 90.0;
for(;;){
double hos;
double change;
char c;
cin >> hos >> c >> change;
if(hos == 0 && change == 0) break;
x += hos * cos(angle * 3.14159 / 180);
y += hos * sin(angle * 3.14159 / 180);
angle -= change;
}
cout << (int)x << endl;
cout << (int)y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:28: error: 'cos' was not declared in this scope; did you mean 'hos'?
16 | x += hos * cos(angle * 3.14159 / 180);
| ^~~
| hos
a.cc:17:28: error: 'sin' was not declared in this scope
17 | y += hos * sin(angle * 3.14159 / 180);
| ^~~
|
s672171964
|
p00016
|
C++
|
#include <iostream>
#include <numeric>
#include <cstdlib>
using namespace std;
int main(){
double x = 0.0;
double y = 0.0;
double angle = 90.0;
for(;;){
double hos;
double change;
char c;
cin >> hos >> c >> change;
if(hos == 0 && change == 0) break;
x += hos * std::cos(angle * 3.14159 / 180);
y += hos * std::sin(angle * 3.14159 / 180);
angle -= change;
}
cout << (int)x << endl;
cout << (int)y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:33: error: 'cos' is not a member of 'std'; did you mean 'ios'?
16 | x += hos * std::cos(angle * 3.14159 / 180);
| ^~~
| ios
a.cc:17:33: error: 'sin' is not a member of 'std'; did you mean 'min'?
17 | y += hos * std::sin(angle * 3.14159 / 180);
| ^~~
| min
|
s713768525
|
p00016
|
C++
|
#include <iostream>
using namespace std;
int main(){
double x = 0.0, y = 0.0;
double hosu;
double angle = 90.0;
double change;
char c;
while(cin >> hosu >> c >> change){
if(hosu == 0 && change == 0) break;
x += hosu * cos(angle / 180 * 3.14159);
y += hosu * sin(angle / 180 * 3.14159);
angle -= change;
}
cout << (int)x << endl;
cout << (int)y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:29: error: 'cos' was not declared in this scope
12 | x += hosu * cos(angle / 180 * 3.14159);
| ^~~
a.cc:13:29: error: 'sin' was not declared in this scope
13 | y += hosu * sin(angle / 180 * 3.14159);
| ^~~
|
s661888268
|
p00016
|
C++
|
d;double x,y,c;main(s){for(;~scanf("%d,%d",&s,&d);c+=d/57.29578)x+=s*sin(c),y+=s*cos(c);exit(!printf("%d\n%d\n",d=x,s=y));}
|
a.cc:1:1: error: 'd' does not name a type
1 | d;double x,y,c;main(s){for(;~scanf("%d,%d",&s,&d);c+=d/57.29578)x+=s*sin(c),y+=s*cos(c);exit(!printf("%d\n%d\n",d=x,s=y));}
| ^
a.cc:1:20: error: expected constructor, destructor, or type conversion before '(' token
1 | d;double x,y,c;main(s){for(;~scanf("%d,%d",&s,&d);c+=d/57.29578)x+=s*sin(c),y+=s*cos(c);exit(!printf("%d\n%d\n",d=x,s=y));}
| ^
|
s418776317
|
p00016
|
C++
|
#include <iostream>
#define M_PI 3.141592653589793
using namespace std;
int debug = 0;
int main(void){
int len, deg, direction=90;
double x=0, y=0;
int i_x, i_y;
while(cin >> len){
cin.ignore(); //read ,
cin >> deg;
if(len == 0 && deg == 0) break;
//proceed
x += len * cos(direction * M_PI / 180);
y += len * sin(direction * M_PI / 180);
//turn clockwise
direction -= deg;
if(debug) cout << "(x, y) = ("<< x << ", "<< y << ")"<< endl;
}
i_x = (int)x;
i_y = (int)y;
cout << i_x << endl;
cout << i_y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:28: error: 'cos' was not declared in this scope
21 | x += len * cos(direction * M_PI / 180);
| ^~~
a.cc:22:28: error: 'sin' was not declared in this scope
22 | y += len * sin(direction * M_PI / 180);
| ^~~
|
s391368391
|
p00016
|
C++
|
#include <iostream>
#define M_PI 3.141592653589793
using namespace std;
int debug = 0;
int main(void){
int len, deg, direction=90;
double x=0, y=0;
int i_x, i_y;
while(cin >> len){
cin.ignore(); //read ,
cin >> deg;
if(len == 0 && deg == 0) break;
//proceed
x += len * cos(direction * M_PI / 180);
y += len * sin(direction * M_PI / 180);
//turn clockwise
direction -= deg;
if(debug) cout << "(x, y) = ("<< x << ", "<< y << ")"<< endl;
}
i_x = (int)x;
i_y = (int)y;
cout << i_x << endl;
cout << i_y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:28: error: 'cos' was not declared in this scope
21 | x += len * cos(direction * M_PI / 180);
| ^~~
a.cc:22:28: error: 'sin' was not declared in this scope
22 | y += len * sin(direction * M_PI / 180);
| ^~~
|
s866446159
|
p00016
|
C++
|
#include <iostream>
using namespace std;
int debug = 0;
int main(void){
int len, deg, direction=90;
double x=0, y=0;
int i_x, i_y;
while(cin >> len){
cin.ignore(); //read ,
cin >> deg;
if(len == 0 && deg == 0) break;
//proceed
x += len * cos(direction * 3.14159265358979 / 180);
y += len * sin(direction * 3.14159265358979 / 180);
//turn clockwise
direction -= deg;
if(debug) cout << "(x, y) = ("<< x << ", "<< y << ")"<< endl;
}
i_x = (int)x;
i_y = (int)y;
cout << i_x << endl;
cout << i_y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:28: error: 'cos' was not declared in this scope
19 | x += len * cos(direction * 3.14159265358979 / 180);
| ^~~
a.cc:20:28: error: 'sin' was not declared in this scope
20 | y += len * sin(direction * 3.14159265358979 / 180);
| ^~~
|
s952439298
|
p00016
|
C++
|
#include <iostream>
#define M_PI 3.141592653589793
using namespace std;
int debug = 0;
int main(void){
int len, deg, direction=90;
double x=0, y=0;
int i_x, i_y;
while(cin >> len){
cin.ignore(); //read ,
cin >> deg;
if(len == 0 && deg == 0) break;
//proceed
x += len * cos(direction * M_PI / 180);
y += len * sin(direction * M_PI / 180);
//turn clockwise
direction -= deg;
}
i_x = x;
i_y = y;
cout << i_x << endl;
cout << i_y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:28: error: 'cos' was not declared in this scope
21 | x += len * cos(direction * M_PI / 180);
| ^~~
a.cc:22:28: error: 'sin' was not declared in this scope
22 | y += len * sin(direction * M_PI / 180);
| ^~~
|
s585484984
|
p00016
|
C++
|
#include <iostream>
#define M_PI 3.141592653589793
using namespace std;
int debug = 0;
int main(void){
int len, deg, direction=90;
double x=0, y=0;
int i_x, i_y;
while(cin >> len){
cin.ignore();
cin >> deg;
if(len == 0 && deg == 0) break;
x += len * cos(direction * M_PI / 180);
y += len * sin(direction * M_PI / 180);
direction -= deg;
}
i_x = x;
i_y = y;
cout << i_x << endl;
cout << i_y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:28: error: 'cos' was not declared in this scope
20 | x += len * cos(direction * M_PI / 180);
| ^~~
a.cc:21:28: error: 'sin' was not declared in this scope
21 | y += len * sin(direction * M_PI / 180);
| ^~~
|
s372102087
|
p00016
|
C++
|
#include <iostream>
#define M_PI 3.141592653589793
using namespace std;
int debug = 0;
int main(void){
int len, deg, direction=90;
double x=0, y=0;
int i_x, i_y;
while(cin >> len){
cin.ignore(); //read ,
cin >> deg;
if(len == 0 && deg == 0) break;
//proceed
x += len * cos(direction * M_PI / 180);
y += len * sin(direction * M_PI / 180);
//turn clockwise
direction -= deg;
}
i_x = x;
i_y = y;
cout << i_x << endl;
cout << i_y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:28: error: 'cos' was not declared in this scope
21 | x += len * cos(direction * M_PI / 180);
| ^~~
a.cc:22:28: error: 'sin' was not declared in this scope
22 | y += len * sin(direction * M_PI / 180);
| ^~~
|
s302196871
|
p00016
|
C++
|
#include <iostream>
static const double M_PI = 6*asin(0.5);
using namespace std;
int debug = 0;
int main(void){
int len, deg, direction=90;
double x=0, y=0;
int i_x, i_y;
while(cin >> len){
cin.ignore(); //read ,
cin >> deg;
if(len == 0 && deg == 0) break;
//proceed
x += len * cos(direction * M_PI / 180);
y += len * sin(direction * M_PI / 180);
//turn clockwise
direction -= deg;
}
i_x = x;
i_y = y;
cout << i_x << endl;
cout << i_y << endl;
return 0;
}
|
a.cc:3:30: error: 'asin' was not declared in this scope
3 | static const double M_PI = 6*asin(0.5);
| ^~~~
a.cc: In function 'int main()':
a.cc:21:28: error: 'cos' was not declared in this scope
21 | x += len * cos(direction * M_PI / 180);
| ^~~
a.cc:22:28: error: 'sin' was not declared in this scope
22 | y += len * sin(direction * M_PI / 180);
| ^~~
|
s424100322
|
p00016
|
C++
|
#include <iostream>
#include <math.h>
using namespace std;
int main(){
int step,turn;
double x=0,y=0,angle;
while(cin>>step>>",">>turn,step,turn){
x+=(double)step*sin(angle*M_PI/180);
y+=(double)step*cos(angle*M_PI/180);
angle+=(double)turn;
}
cout << (int)x << endl;
cout << (int)y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:16: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'const char [2]')
7 | while(cin>>step>>",">>turn,step,turn){
| ~~~~~~~~~^~~~~
| | |
| | const char [2]
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:18: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'const char*'
7 | while(cin>>step>>",">>turn,step,turn){
| ^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:18: error: invalid conversion from 'const char*' to 'short int' [-fpermissive]
7 | while(cin>>step>>",">>turn,step,turn){
| ^~~
| |
| const char*
a.cc:7:18: error: cannot bind rvalue '(short int)((const char*)",")' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:18: error: invalid conversion from 'const char*' to 'short unsigned int' [-fpermissive]
7 | while(cin>>step>>",">>turn,step,turn){
| ^~~
| |
| const char*
a.cc:7:18: error: cannot bind rvalue '(short unsigned int)((const char*)",")' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:18: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
7 | while(cin>>step>>",">>turn,step,turn){
| ^~~
| |
| const char*
a.cc:7:18: error: cannot bind rvalue '(int)((const char*)",")' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:18: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
7 | while(cin>>step>>",">>turn,step,turn){
| ^~~
| |
| const char*
a.cc:7:18: error: cannot bind rvalue '(unsigned int)((const char*)",")' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:18: error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
7 | while(cin>>step>>",">>turn,step,turn){
| ^~~
| |
| const char*
a.cc:7:18: error: cannot bind rvalue '(long int)((const char*)",")' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:18: error: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive]
7 | while(cin>>step>>",">>turn,step,turn){
| ^~~
| |
| const char*
a.cc:7:18: error: cannot bind rvalue '(long unsigned int)((const char*)",")' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:18: error: invalid conversion from 'const char*' to 'long long int' [-fpermissive]
7 | while(cin>>step>>",">>turn,step,turn){
| ^~~
| |
| const char*
a.cc:7:18: error: cannot bind rvalue '(long long int)((const char*)",")' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:18: error: invalid conversion from 'const char*' to 'long long unsigned int' [-fpermissive]
7 | while(cin>>step>>",">>turn,step,turn){
| ^~~
| |
| const char*
a.cc:7:18: error: cannot bind rvalue '(long long unsigned int)((const char*)",")' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:18: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
7 | while(cin>>step>>",">>turn,step,turn){
| ^~~
| |
| const void*
a.cc:7:18: error: cannot bind rvalue '(void*)((const void*)((const char*)","))' to 'void*&'
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'const char [2]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'const char [2]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'const char [2]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'const char [2]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basi
|
s603463486
|
p00016
|
C++
|
#include <cmath>
#include <cstdio>
#define calc(x) (x*M_PI/180.0)
using namespace std;
int main()
{
string str;
int a, b;
double x=0, y=0, r=0;
while(scanf("%d,%d",&a,&b) != EOF && !(a == 0 && b == 0)){
x += (double)a*sin(calc(r));
y += (double)a*cos(calc(r));
r += (double)b;
}
printf("%d\n%d\n", (int)x, (int)y);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:3: error: 'string' was not declared in this scope
10 | string str;
| ^~~~~~
a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
2 | #include <cstdio>
+++ |+#include <string>
3 |
|
s765092391
|
p00016
|
C++
|
float x,y,z;d;main(r){for(;~scanf("%d,%d",&r,&d)?y+=r*cos(z),x-=r*sin(z),z-=d/57.3,1:!printf("%d\n%d\n",d=x,r=y););}
|
a.cc:1:13: error: 'd' does not name a type
1 | float x,y,z;d;main(r){for(;~scanf("%d,%d",&r,&d)?y+=r*cos(z),x-=r*sin(z),z-=d/57.3,1:!printf("%d\n%d\n",d=x,r=y););}
| ^
a.cc:1:19: error: expected constructor, destructor, or type conversion before '(' token
1 | float x,y,z;d;main(r){for(;~scanf("%d,%d",&r,&d)?y+=r*cos(z),x-=r*sin(z),z-=d/57.3,1:!printf("%d\n%d\n",d=x,r=y););}
| ^
|
s291520970
|
p00016
|
C++
|
float x,y,z;d;main(r){for(;~scanf("%d,%d",&r,&d)?y+=r*cos(z),x-=r*sin(z),z-=d/57.3,1:!printf("%d\n%d\n",d=x,r=y););}
|
a.cc:1:13: error: 'd' does not name a type
1 | float x,y,z;d;main(r){for(;~scanf("%d,%d",&r,&d)?y+=r*cos(z),x-=r*sin(z),z-=d/57.3,1:!printf("%d\n%d\n",d=x,r=y););}
| ^
a.cc:1:19: error: expected constructor, destructor, or type conversion before '(' token
1 | float x,y,z;d;main(r){for(;~scanf("%d,%d",&r,&d)?y+=r*cos(z),x-=r*sin(z),z-=d/57.3,1:!printf("%d\n%d\n",d=x,r=y););}
| ^
|
s323585731
|
p00016
|
C++
|
#include <iostream>
#include <cmath>
#define PI 3.14159265;
#define RAD (PI/180)
using namespace std;
int main() {
int m, angle;
double x=0, y=0, deg=90;
while(1) {
cin >> m >> angle;
if(m==0&&angle==0)
break;
x+=(double)m*cos(deg*RAD);
y+=(double)m*sin(deg*RAD);
deg-=angle;
}
cout << (int)x << endl << (int)y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:3:22: error: expected ')' before ';' token
3 | #define PI 3.14159265;
| ^
a.cc:4:14: note: in expansion of macro 'PI'
4 | #define RAD (PI/180)
| ^~
a.cc:17:38: note: in expansion of macro 'RAD'
17 | x+=(double)m*cos(deg*RAD);
| ^~~
a.cc:4:13: note: to match this '('
4 | #define RAD (PI/180)
| ^
a.cc:17:38: note: in expansion of macro 'RAD'
17 | x+=(double)m*cos(deg*RAD);
| ^~~
a.cc:3:22: error: expected ')' before ';' token
3 | #define PI 3.14159265;
| ^
a.cc:4:14: note: in expansion of macro 'PI'
4 | #define RAD (PI/180)
| ^~
a.cc:17:38: note: in expansion of macro 'RAD'
17 | x+=(double)m*cos(deg*RAD);
| ^~~
a.cc:17:33: note: to match this '('
17 | x+=(double)m*cos(deg*RAD);
| ^
a.cc:4:16: error: expected primary-expression before '/' token
4 | #define RAD (PI/180)
| ^
a.cc:17:38: note: in expansion of macro 'RAD'
17 | x+=(double)m*cos(deg*RAD);
| ^~~
a.cc:3:22: error: expected ')' before ';' token
3 | #define PI 3.14159265;
| ^
a.cc:4:14: note: in expansion of macro 'PI'
4 | #define RAD (PI/180)
| ^~
a.cc:18:38: note: in expansion of macro 'RAD'
18 | y+=(double)m*sin(deg*RAD);
| ^~~
a.cc:4:13: note: to match this '('
4 | #define RAD (PI/180)
| ^
a.cc:18:38: note: in expansion of macro 'RAD'
18 | y+=(double)m*sin(deg*RAD);
| ^~~
a.cc:3:22: error: expected ')' before ';' token
3 | #define PI 3.14159265;
| ^
a.cc:4:14: note: in expansion of macro 'PI'
4 | #define RAD (PI/180)
| ^~
a.cc:18:38: note: in expansion of macro 'RAD'
18 | y+=(double)m*sin(deg*RAD);
| ^~~
a.cc:18:33: note: to match this '('
18 | y+=(double)m*sin(deg*RAD);
| ^
a.cc:4:16: error: expected primary-expression before '/' token
4 | #define RAD (PI/180)
| ^
a.cc:18:38: note: in expansion of macro 'RAD'
18 | y+=(double)m*sin(deg*RAD);
| ^~~
|
s540706080
|
p00016
|
C++
|
#include<iostream>
#include<math>
#define conv 0.0174532925199
using namespace std;
int main()
{
double x=0.0,y=0.0,m,r,rad=0;
char a;
for(;;)
{
cin >> m >> a >> r ;
if(m==0 && r==0)
break;
x+=m*sin(rad*conv);
y+=m*cos(rad*conv);
rad+=r;
}
cout << (int)x << endl;
cout << (int)y << endl;
}
|
a.cc:2:9: fatal error: math: No such file or directory
2 | #include<math>
| ^~~~~~
compilation terminated.
|
s559448625
|
p00016
|
C++
|
/*AOJ 0016*/
#include<iostream>
#define M_PI 3.14159265
using namespace std;
double changeDegToRad(double deg){
return deg*M_PI/180.0;
}
int main(){
double x = 0,y = 0;
double deg = 0,walk = 0;
double rad = M_PI/2.0;
while(1){
scanf("%lf,%lf",&walk,°);
if(deg==0&&walk==0){
break;
}
x += walk * cos(rad);
y += walk * sin(rad);
rad -= changeDegToRad(deg);
}
cout<<(int)x<<" "<<(int)y<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:28:29: error: 'cos' was not declared in this scope
28 | x += walk * cos(rad);
| ^~~
a.cc:29:29: error: 'sin' was not declared in this scope
29 | y += walk * sin(rad);
| ^~~
|
s065852289
|
p00016
|
C++
|
/*AOJ 0016*/
#include<iostream>
#define M_PI 3.14159265
using namespace std;
double changeDegToRad(double deg){
return deg*M_PI/180.0;
}
int main(){
double x = 0,y = 0;
double deg = 0,walk = 0;
double rad = M_PI/2.0;
while(1){
scanf("%lf,%lf",&walk,°);
if(deg==0&&walk==0){
break;
}
x += walk * cos(rad);
y += walk * sin(rad);
rad -= changeDegToRad(deg);
}
cout<<(int)x<<endl;
cout<<(int)y<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:28:29: error: 'cos' was not declared in this scope
28 | x += walk * cos(rad);
| ^~~
a.cc:29:29: error: 'sin' was not declared in this scope
29 | y += walk * sin(rad);
| ^~~
|
s471438487
|
p00016
|
C++
|
#include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<set>
#include<cmath>
using namespace std;
int main(){
double a,b; double c=90; double x=0; double y=0;
while(scanf("%lf%lf",&a,&b) a || b){
x+=a*cos(c*M_PI/180);
y+=a*sin(c*M_PI/180);
c-=b;
}
printf("%d\n %d\n",(int)x,(int)y);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:36: error: expected ')' before 'a'
18 | while(scanf("%lf%lf",&a,&b) a || b){
| ~ ^~
| )
a.cc:18:43: error: expected ';' before ')' token
18 | while(scanf("%lf%lf",&a,&b) a || b){
| ^
| ;
|
s686384809
|
p00016
|
C++
|
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include <math.h>
 
void walk(double current_point[2], int r, int sum_theta) {
    double pi = 3.14159265358979; 
    double rad = ((double)sum_theta / 180) * pi;
    current_point[0] += r * sin(rad);
    current_point[1] += r * cos(rad);
}
 
int main() {
    int r;
    int theta;
    int sum_theta = 0;
    double current_point[2] = {0, 0};
 
    do {
        scanf("%d,%d", &r, &theta);
 
        walk(current_point, r, sum_theta);
        sum_theta += theta;
    } while(r || theta);
 
    printf("%d\n", (int)current_point[0]);
    printf("%d\n", (int)current_point[1]);
 
    return 0;
}
|
a.cc:32:2: error: stray '#' in program
32 |  
| ^
a.cc:34:2: error: stray '#' in program
34 |     double pi = 3.14159265358979; 
| ^
a.cc:34:9: error: stray '#' in program
34 |     double pi = 3.14159265358979; 
| ^
a.cc:34:45: error: stray '#' in program
34 |     double pi = 3.14159265358979; 
| ^
a.cc:35:2: error: stray '#' in program
35 |     double rad = ((double)sum_theta / 180) * pi;
| ^
a.cc:35:9: error: stray '#' in program
35 |     double rad = ((double)sum_theta / 180) * pi;
| ^
a.cc:36:2: error: stray '#' in program
36 |     current_point[0] += r * sin(rad);
| ^
a.cc:36:9: error: stray '#' in program
36 |     current_point[0] += r * sin(rad);
| ^
a.cc:37:2: error: stray '#' in program
37 |     current_point[1] += r * cos(rad);
| ^
a.cc:37:9: error: stray '#' in program
37 |     current_point[1] += r * cos(rad);
| ^
a.cc:39:2: error: stray '#' in program
39 |  
| ^
a.cc:41:2: error: stray '#' in program
41 |     int r;
| ^
a.cc:41:9: error: stray '#' in program
41 |     int r;
| ^
a.cc:42:2: error: stray '#' in program
42 |     int theta;
| ^
a.cc:42:9: error: stray '#' in program
42 |     int theta;
| ^
a.cc:43:2: error: stray '#' in program
43 |     int sum_theta = 0;
| ^
a.cc:43:9: error: stray '#' in program
43 |     int sum_theta = 0;
| ^
a.cc:44:2: error: stray '#' in program
44 |     double current_point[2] = {0, 0};
| ^
a.cc:44:9: error: stray '#' in program
44 |     double current_point[2] = {0, 0};
| ^
a.cc:45:2: error: stray '#' in program
45 |  
| ^
a.cc:46:2: error: stray '#' in program
46 |     do {
| ^
a.cc:46:9: error: stray '#' in program
46 |     do {
| ^
a.cc:47:2: error: stray '#' in program
47 |         scanf("%d,%d", &r, &theta);
| ^
a.cc:47:9: error: stray '#' in program
47 |         scanf("%d,%d", &r, &theta);
| ^
a.cc:47:16: error: stray '#' in program
47 |         scanf("%d,%d", &r, &theta);
| ^
a.cc:47:23: error: stray '#' in program
47 |         scanf("%d,%d", &r, &theta);
| ^
a.cc:48:2: error: stray '#' in program
48 |  
| ^
a.cc:49:2: error: stray '#' in program
49 |         walk(current_point, r, sum_theta);
| ^
a.cc:49:9: error: stray '#' in program
49 |         walk(current_point, r, sum_theta);
| ^
a.cc:49:16: error: stray '#' in program
49 |         walk(current_point, r, sum_theta);
| ^
a.cc:49:23: error: stray '#' in program
49 |         walk(current_point, r, sum_theta);
| ^
a.cc:50:2: error: stray '#' in program
50 |         sum_theta += theta;
| ^
a.cc:50:9: error: stray '#' in program
50 |         sum_theta += theta;
| ^
a.cc:50:16: error: stray '#' in program
50 |         sum_theta += theta;
| ^
a.cc:50:23: error: stray '#' in program
50 |         sum_theta += theta;
| ^
a.cc:51:2: error: stray '#' in program
51 |     } while(r || theta);
| ^
a.cc:51:9: error: stray '#' in program
51 |     } while(r || theta);
| ^
a.cc:52:2: error: stray '#' in program
52 |  
| ^
a.cc:53:2: error: stray '#' in program
53 |     printf("%d\n", (int)current_point[0]);
| ^
a.cc:53:9: error: stray '#' in program
53 |     printf("%d\n", (int)current_point[0]);
| ^
a.cc:54:2: error: stray '#' in program
54 |     printf("%d\n", (int)current_point[1]);
| ^
a.cc:54:9: error: stray '#' in program
54 |     printf("%d\n", (int)current_point[1]);
| ^
a.cc:55:2: error: stray '#' in program
55 |  
| ^
a.cc:56:2: error: stray '#' in program
56 |     return 0;
| ^
a.cc:56:9: error: stray '#' in program
56 |     return 0;
| ^
a.cc:1:1: error: expected unqualified-id before '?' token
1 | ?
| ^
In file included from /usr/include/math.h:275,
from /usr/include/c++/14/cmath:47,
from /usr/include/c++/14/math.h:36,
from a.cc:31:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,,
|
s820711279
|
p00016
|
C++
|
#include <stdio.h>
#include <math.h>
 
void walk(double current_point[2], int r, int sum_theta) {
    double pi = 3.14159265358979; 
    double rad = ((double)sum_theta / 180) * pi;
    current_point[0] += r * sin(rad);
    current_point[1] += r * cos(rad);
}
 
int main() {
    int r;
    int theta;
    int sum_theta = 0;
    double current_point[2] = {0, 0};
 
    do {
        scanf("%d,%d", &r, &theta);
 
        walk(current_point, r, sum_theta);
        sum_theta += theta;
    } while(r || theta);
 
    printf("%d\n", (int)current_point[0]);
    printf("%d\n", (int)current_point[1]);
 
    return 0;
}
|
a.cc:3:2: error: stray '#' in program
3 |  
| ^
a.cc:5:2: error: stray '#' in program
5 |     double pi = 3.14159265358979; 
| ^
a.cc:5:9: error: stray '#' in program
5 |     double pi = 3.14159265358979; 
| ^
a.cc:5:45: error: stray '#' in program
5 |     double pi = 3.14159265358979; 
| ^
a.cc:6:2: error: stray '#' in program
6 |     double rad = ((double)sum_theta / 180) * pi;
| ^
a.cc:6:9: error: stray '#' in program
6 |     double rad = ((double)sum_theta / 180) * pi;
| ^
a.cc:7:2: error: stray '#' in program
7 |     current_point[0] += r * sin(rad);
| ^
a.cc:7:9: error: stray '#' in program
7 |     current_point[0] += r * sin(rad);
| ^
a.cc:8:2: error: stray '#' in program
8 |     current_point[1] += r * cos(rad);
| ^
a.cc:8:9: error: stray '#' in program
8 |     current_point[1] += r * cos(rad);
| ^
a.cc:10:2: error: stray '#' in program
10 |  
| ^
a.cc:12:2: error: stray '#' in program
12 |     int r;
| ^
a.cc:12:9: error: stray '#' in program
12 |     int r;
| ^
a.cc:13:2: error: stray '#' in program
13 |     int theta;
| ^
a.cc:13:9: error: stray '#' in program
13 |     int theta;
| ^
a.cc:14:2: error: stray '#' in program
14 |     int sum_theta = 0;
| ^
a.cc:14:9: error: stray '#' in program
14 |     int sum_theta = 0;
| ^
a.cc:15:2: error: stray '#' in program
15 |     double current_point[2] = {0, 0};
| ^
a.cc:15:9: error: stray '#' in program
15 |     double current_point[2] = {0, 0};
| ^
a.cc:16:2: error: stray '#' in program
16 |  
| ^
a.cc:17:2: error: stray '#' in program
17 |     do {
| ^
a.cc:17:9: error: stray '#' in program
17 |     do {
| ^
a.cc:18:2: error: stray '#' in program
18 |         scanf("%d,%d", &r, &theta);
| ^
a.cc:18:9: error: stray '#' in program
18 |         scanf("%d,%d", &r, &theta);
| ^
a.cc:18:16: error: stray '#' in program
18 |         scanf("%d,%d", &r, &theta);
| ^
a.cc:18:23: error: stray '#' in program
18 |         scanf("%d,%d", &r, &theta);
| ^
a.cc:19:2: error: stray '#' in program
19 |  
| ^
a.cc:20:2: error: stray '#' in program
20 |         walk(current_point, r, sum_theta);
| ^
a.cc:20:9: error: stray '#' in program
20 |         walk(current_point, r, sum_theta);
| ^
a.cc:20:16: error: stray '#' in program
20 |         walk(current_point, r, sum_theta);
| ^
a.cc:20:23: error: stray '#' in program
20 |         walk(current_point, r, sum_theta);
| ^
a.cc:21:2: error: stray '#' in program
21 |         sum_theta += theta;
| ^
a.cc:21:9: error: stray '#' in program
21 |         sum_theta += theta;
| ^
a.cc:21:16: error: stray '#' in program
21 |         sum_theta += theta;
| ^
a.cc:21:23: error: stray '#' in program
21 |         sum_theta += theta;
| ^
a.cc:22:2: error: stray '#' in program
22 |     } while(r || theta);
| ^
a.cc:22:9: error: stray '#' in program
22 |     } while(r || theta);
| ^
a.cc:23:2: error: stray '#' in program
23 |  
| ^
a.cc:24:2: error: stray '#' in program
24 |     printf("%d\n", (int)current_point[0]);
| ^
a.cc:24:9: error: stray '#' in program
24 |     printf("%d\n", (int)current_point[0]);
| ^
a.cc:25:2: error: stray '#' in program
25 |     printf("%d\n", (int)current_point[1]);
| ^
a.cc:25:9: error: stray '#' in program
25 |     printf("%d\n", (int)current_point[1]);
| ^
a.cc:26:2: error: stray '#' in program
26 |  
| ^
a.cc:27:2: error: stray '#' in program
27 |     return 0;
| ^
a.cc:27:9: error: stray '#' in program
27 |     return 0;
| ^
a.cc:3:3: error: expected unqualified-id before numeric constant
3 |  
| ^~~
a.cc: In function 'void walk(double*, int, int)':
a.cc:5:3: error: lvalue required as unary '&' operand
5 |     double pi = 3.14159265358979; 
| ^~~
a.cc:5:10: error: lvalue required as unary '&' operand
5 |     double pi = 3.14159265358979; 
| ^~~
a.cc:5:46: error: lvalue required as unary '&' operand
5 |     double pi = 3.14159265358979; 
| ^~~
a.cc:6:3: error: lvalue required as unary '&' operand
6 |     double rad = ((double)sum_theta / 180) * pi;
| ^~~
a.cc:6:10: error: lvalue required as unary '&' operand
6 |     double rad = ((double)sum_theta / 180) * pi;
| ^~~
a.cc:7:3: error: lvalue required as unary '&' operand
7 |     current_point[0] += r * sin(rad);
| ^~~
a.cc:7:10: error: lvalue required as unary '&' operand
7 |     current_point[0] += r * sin(rad);
| ^~~
a.cc:8:3: error: lvalue required as unary '&' operand
8 |     current_point[1] += r * cos(rad);
| ^~~
a.cc:8:10: error: lvalue required as unary '&' operand
8 |     current_point[1] += r * cos(rad);
| ^~~
a.cc: At global scope:
a.cc:10:3: error: expected unqualified-id before numeric constant
10 |  
| ^~~
a.cc: In function 'int main()':
a.cc:12:3: error: lvalue required as unary '&' operand
12 |     int r;
| ^~~
a.cc:12:10: error: lvalue required as unary '&' operand
12 |     int r;
| ^~~
a.cc:13:3: error: lvalue required as unary '&' operand
13 |     int theta;
| ^~~
a.cc:13:10: error: lvalue required as unary '&' operand
13 |     int theta;
| ^~~
a.cc:14:3: error: lvalue required as unary '&' operand
14 |     int sum_theta = 0;
| ^~~
a.cc:14:10: error: lvalue required as unary '&' operand
14 |     int sum_theta = 0;
| ^~~
a.cc:15:3: error: lvalue required as unary '&' operand
15 |     double current_point[2] = {0, 0};
| ^~~
a.cc:15:10: error: lvalue required as unary '&' operand
15 |     double current_point[2] = {0, 0};
| ^~~
a.cc:16:3: error: lvalue required as unary '&' operand
16 |  
| ^~~
a.cc:17:3: error: lvalue required as unary '&' operand
17 |     do {
| ^~~
a.cc:17:10: error: lvalue required as unary '&' operand
17 |     do {
| ^~~
a.cc:18:3: error: lvalue required as unary '&' operand
18 |         scanf("%d,%d", &r, &theta);
| ^~~
a.cc:18:10: error: lvalue required as unary '&' operand
18 |         scanf("%d,%d", &r, &theta);
| ^~~
a.cc:18:17: error: lvalue required as unary '&' operand
18 |         scanf("%d,%d", &r, &theta);
| ^~~
a.cc:18:24: error: lvalue required as unary '&' operand
18 |         scanf("%d,%d", &r, &theta);
| ^~~
a.cc:19:3: error: lvalue required as unary '&' operand
19 |  
| ^~~
a.cc:20:3: error: lvalue required as unary '&' operand
20 |         walk(current_point, r, sum_theta);
| ^~~
a.cc:20:10: error: lvalue required as unary '&' operand
20 |         walk(current_point, r, sum_theta);
| ^~~
a.cc:20:17: error: lvalue required as unary '&' operand
20 |         walk(current_point, r, sum_theta);
| ^~~
a.cc:20:24: error: lvalue required as unary '&' operand
20 |         walk(current_point, r, sum_theta);
| ^~~
a.cc:21:3: error: lvalue required as unary '&' operand
21 |         sum_theta += theta;
| ^~~
a.cc:21:10: error: lvalue required as unary '&' operand
21 |         sum_theta += theta;
| ^~~
a.cc:21:17: error: lvalue required as unary '&' operand
21 |         sum_theta += theta;
| ^~~
a.cc:21:24: error: lvalue required as unary '&' operand
21 |         sum_theta += theta;
| ^~~
a.cc:22:3: error: lvalue required as unary '&' operand
22 |     } while(r || theta);
| ^~~
a.cc:22:10: error: lvalue required as unary '&' operand
22 |     } while(r || theta);
| ^~~
a.cc:23:3: error: lvalue required as unary '&' operand
23 |  
| ^~~
a.cc:24:3: error: lvalue required as unary '&' operand
24 |     printf("%d\n", (int)current_point[0]);
| ^~~
a.cc:24:10: error: lvalue required as unary '&' operand
24 |     printf("%d\n", (int)current_point[0]);
| ^~~
a.cc:25:3: error: lvalue required as unary '&' operand
25 |     printf("%d\n", (int)current_point[1]);
| ^~~
a.cc:25:10: error: lvalue required as unary '&' operand
25 |     printf("%d\n", (int)current_point[1]);
| ^~~
a.cc:26:3: error: lvalue required as unary '&' operand
26 |  
| ^~~
a.cc:27:3: error: lvalue required as unary '&' operand
27 |     return 0;
| ^~~
a.cc:27:10: error: lvalue required
|
s284118067
|
p00016
|
C++
|
#include <stdio.h>
#include <string.h>
int main(){
double x,y,angle,t,r;
x=0;
y=0;
angle=M_PI/2;
while(1){
scanf("%lf,%lf",&r,&t);
if(r==0&&t==0)break;
x+=r*cos(angle);
y+=r*sin(angle);
angle+=t*M_PI/180;
}
printf("%.0f\n%.0f\n",-x,y);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:7: error: 'M_PI' was not declared in this scope
8 | angle=M_PI/2;
| ^~~~
a.cc:12:6: error: 'cos' was not declared in this scope
12 | x+=r*cos(angle);
| ^~~
a.cc:13:6: error: 'sin' was not declared in this scope; did you mean 'stdin'?
13 | y+=r*sin(angle);
| ^~~
| stdin
|
s937516356
|
p00016
|
C++
|
#include<iostream>
#include<cmath>
#define PI 3.141592653589793
using namespace std;
int main(){
double x = 0, y = 0;
int l, a;
while(scanf_s("%d,%d",l,a) != -1){
x += l * cos(a * PI / 180);
y += l * sin(a * PI / 180);
}
cout << (int)x << endl << (int)y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
11 | while(scanf_s("%d,%d",l,a) != -1){
| ^~~~~~~
| scanf
|
s363822397
|
p00016
|
C++
|
#include<iostream>
#include<math.h>
#include<cstdio>
#define M_PI 3.14159265358979 /* 円周率 */
using namespace std;
int main(){
int len, deg;
int deg_now = 90;
double x = 0, y = 0;
while (1){
scanf_s("%d,%d", &len, °);
if (len == 0 && deg == 0) break;
x += len*cos(deg_now / 180.0 * M_PI);
y += len*sin(deg_now / 180.0 * M_PI);
deg_now += deg;
}
printf("%d\n%d\n", (int)x, (int)y);
return 0;
}
|
a.cc:4:9: warning: "M_PI" redefined
4 | #define M_PI 3.14159265358979 /* 円周率 */
| ^~~~
In file included from /usr/include/c++/14/cmath:47,
from /usr/include/c++/14/math.h:36,
from a.cc:2:
/usr/include/math.h:1121:10: note: this is the location of the previous definition
1121 | # define M_PI 3.14159265358979323846 /* pi */
| ^~~~
a.cc: In function 'int main()':
a.cc:14:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
14 | scanf_s("%d,%d", &len, °);
| ^~~~~~~
| scanf
|
s710235438
|
p00016
|
C++
|
#include<iostream>
#include<math.h>
#include<stdio.h>
#define M_PI 3.14159265358979 /* 円周率 */
using namespace std;
int main(){
int len, deg;
int deg_now = 90;
double x = 0, y = 0;
while (1){
scanf_s("%d,%d", &len, °);
if (len == 0 && deg == 0) break;
x += len*cos(deg_now / 180.0 * M_PI);
y += len*sin(deg_now / 180.0 * M_PI);
deg_now += deg;
}
printf("%d\n%d\n", (int)x, (int)y);
return 0;
}
|
a.cc:4:9: warning: "M_PI" redefined
4 | #define M_PI 3.14159265358979 /* 円周率 */
| ^~~~
In file included from /usr/include/c++/14/cmath:47,
from /usr/include/c++/14/math.h:36,
from a.cc:2:
/usr/include/math.h:1121:10: note: this is the location of the previous definition
1121 | # define M_PI 3.14159265358979323846 /* pi */
| ^~~~
a.cc: In function 'int main()':
a.cc:14:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
14 | scanf_s("%d,%d", &len, °);
| ^~~~~~~
| scanf
|
s303703506
|
p00017
|
Java
|
import java.io.*;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Pattern p=Pattern.compile("the|this|that");
String str;
try{
while((str=br.readLine())!=null){
char[] ch=str.toCharArray();
for(int j=0;!pattern.matcher(str).find()&&j<26;j++){
for(int i=0;i<ch.length;i++){
if('a'<=ch[i]&&ch[i]<'z'){
ch[i]++;
}else if(ch[i]=='z'){
ch[i]='a';
}
}
if(p.matcher(String.valueOf(ch)).find()){
break;
}
}
System.out.println(ch);
}
}catch(Exception e){
}
}
}
|
Main.java:12: error: cannot find symbol
for(int j=0;!pattern.matcher(str).find()&&j<26;j++){
^
symbol: variable pattern
location: class Main
1 error
|
s455328212
|
p00017
|
Java
|
import java.io.*;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args){
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Pattern p=Pattern.compile("the|this|that");
String str;
while((str=br.readLine())!=null){
char[] ch=str.toCharArray();
for(int j=0;!p.matcher(str).find()&&j<26;j++){
for(int i=0;i<ch.length;i++){
if('a'<=ch[i]&&ch[i]<'z'){
ch[i]++;
}else if(ch[i]=='z'){
ch[i]='a';
}
}
if(p.matcher(String.valueOf(ch)).find()){
break;
}
}
System.out.println(ch);
}
}
}
|
Main.java:10: error: unreported exception IOException; must be caught or declared to be thrown
while((str=br.readLine())!=null){
^
1 error
|
s453526083
|
p00017
|
Java
|
import java.io.*;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Pattern p=Pattern.compile("the|this|that");
String str;
while((str=br.readLine())!=null){
char[] ch=str.toCharArray();
for(int j=0;!p.matcher((String.valueOf(ch)).find()&&j<26;j++){
for(int i=0;i<ch.length;i++){
if('a'<=ch[i]&&ch[i]<'z'){
ch[i]++;
}else if(ch[i]=='z'){
ch[i]='a';
}
}
if(p.matcher(String.valueOf(ch)).find()){
break;
}
}
System.out.println(ch);
}
}
}
|
Main.java:12: error: ')' or ',' expected
for(int j=0;!p.matcher((String.valueOf(ch)).find()&&j<26;j++){
^
1 error
|
s528670491
|
p00017
|
Java
|
mport java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
while (scn.hasNext()) {
String str = scn.nextLine();
int len = str.length();
a:
while (true) {
String nstr = new String();
for (int i = 0; i < len; i++) {
int n = str.charAt(i); //??¢???????????????????????????
if (n > 96 && n < 122) {
n = n + 1; //?¬??????¢??????????????????
} else if (n == 122) {
n = 97; //z??????a?????????
}
nstr = nstr + (char)n; //???????????????
}
str = nstr;
String[] words = str.split(" ");
for (int i = 0; i < words.length; i++) {
//??????????°?????????????????????????
if (words[i].charAt(words[i].length() - 1) == '.') {
words[i] = words[i].substring(0, words[i].length() - 2);
}
//the,this,that???????????°????????????
if (words[i].equals("the") || words[i].equals("this") ||
words[i].equals("that")) break a;
}
}
System.out.println(str);
}
}
}
|
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
|
s546504439
|
p00017
|
Java
|
import java.util.Scanner;
public class Mai {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
String moji = sc.nextLine();
char[] narabi = moji.toCharArray();
String temp = "";
for(int j = 0; j < 26; j++){
for(int i = 0; i < narabi.length; i++){
if('a' <= narabi[i] && narabi[i] <= 'z')
if(narabi[i] == 'z')
narabi[i] = 'a';
else
narabi[i]++;
}
temp = String.valueOf(narabi);
if(temp.contains("that") || temp.contains("this") || temp.contains("the")){
System.out.println(temp);
break;
}
}
}
}
}
|
Main.java:2: error: class Mai is public, should be declared in a file named Mai.java
public class Mai {
^
1 error
|
s603343130
|
p00017
|
Java
|
import java.util.Scanner;
public class Mai {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
String moji = sc.nextLine();
char[] n = moji.toCharArray();
String temp = "";
for(int j = 0; j < 26; j++){
for(int i = 0; i < n.length; i++){
if('a' <= n[i] && n[i] <= 'z')
if(n[i] == 'z')
n[i] = 'a';
else
n[i]++;
}
temp = String.valueOf(n);
if(temp.contains("that") || temp.contains("this") || temp.contains("the")){
System.out.println(temp);
break;
}
}
}
}
}
|
Main.java:2: error: class Mai is public, should be declared in a file named Mai.java
public class Mai {
^
1 error
|
s511711222
|
p00017
|
Java
|
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = null;
try {
sc = new Scanner(System.in);
char[] originalCharactors = sc.nextLine().toCharArray();
// ずらした文字数を調べる
int restrationCode = -1;
for (int i = 0; i < originalCharactors.length - 1; i++) {
int code = originalCharactors[0] - 't';
if (isRestrationCode(code, originalCharactors, i)) {
restrationCode = code;
break;
}
}
// 復元する
char[] tartgetCharactors = displace(restrationCode,
originalCharactors);
// 出力する
print(tartgetCharactors);
} finally {
sc.close();
}
}
private static boolean isRestrationCode(int code, char[] cArrays, int start) {
if ((cArrays[start + 1] - code) == 'h') {
if ((cArrays[start + 2] - code) == 'e') {
return true;
} else if ((cArrays[start + 2] - code) == 'i') {
if ((cArrays[start + 3] - code) == 's') {
return true;
} else if ((cArrays[start + 2] - code) == 'a') {
if ((cArrays[start + 3] - code) == 't') {
return true;
}
}
}
}
return false;
}
private static char[] displace(int code, char[] originalCharactors) {
char[] targetCharactors = new char[originalCharactors.length];
int i = 0;
char piriod = '.';
for (char c : originalCharactors) {
if (piriod != c) {
c -= code;
}
targetCharactors[i] = (char) c;
i++;
}
return targetCharactors;
}
private static void print(char[] cArrays) {
StringBuilder sb = new StringBuilder();
int i = 0;
for (char c : cArrays) {
if(c==28){
sb.append(" ");
}else {
sb.append(c);
}
i++;
}
System.out.println(sb.toString());
}
|
Main.java:80: error: reached end of file while parsing
}
^
1 error
|
s821537132
|
p00017
|
Java
|
class Main {
public static void main(String[] args) {
Scanner sc = null;
try {
while(sc.hasNextLine()){
sc = new Scanner(System.in);
char[] originalCharactors = sc.nextLine().toCharArray();
// ずらした文字数を調べる
int restrationCode = -1;
for (int i = 0; i < originalCharactors.length - 1; i++) {
int code = originalCharactors[0] - 't';
if (isRestrationCode(code, originalCharactors, i)) {
restrationCode = code;
break;
}
}
// 復元する
char[] tartgetCharactors = displace(restrationCode,
originalCharactors);
// 出力する
print(tartgetCharactors);
}
} finally {
sc.close();
}
}
private static boolean isRestrationCode(int code, char[] cArrays, int start) {
if ((cArrays[start + 1] - code) == 'h') {
if ((cArrays[start + 2] - code) == 'e') {
return (cArrays[start + 3] - code) == 28;
} else if ((cArrays[start + 2] - code) == 'i') {
if ((cArrays[start + 3] - code) == 's') {
return (cArrays[start + 4] - code) == 28;
} else if ((cArrays[start + 2] - code) == 'a') {
if ((cArrays[start + 3] - code) == 't') {
return (cArrays[start + 4] - code) == 28;
}
}
}
}
return false;
}
private static char[] displace(int code, char[] originalCharactors) {
char[] targetCharactors = new char[originalCharactors.length];
int i = 0;
char piriod = '.';
for (char c : originalCharactors) {
if (piriod != c) {
c -= code;
}
targetCharactors[i] = (char) c;
i++;
}
return targetCharactors;
}
private static void print(char[] cArrays) {
StringBuilder sb = new StringBuilder();
int i = 0;
for (char c : cArrays) {
System.out.println((int) c);
if (c == 28 || c == 32) {
sb.append(" ");
} else {
sb.append(c);
}
i++;
}
System.out.println(sb.toString());
}
}
|
Main.java:5: error: cannot find symbol
Scanner sc = null;
^
symbol: class Scanner
location: class Main
Main.java:8: error: cannot find symbol
sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s268032733
|
p00017
|
Java
|
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = null;
try {
sc = new Scanner(System.in);
while (sc.hasNextLine()) {
char[] originalCharactors = sc.nextLine().toCharArray();
// ずらした文字数を調べる
int restrationCode = 0;
for (int i = 0; i < originalCharactors.length - 1; i++) {
int code = originalCharactors[i] - 't';
if (isRestrationCode(code, originalCharactors, i)) {
restrationCode = code;
break;
}
}
// 復元する
char[] tartgetCharactors = displace(restrationCode,
originalCharactors);
// 出力する
print(tartgetCharactors);
}
} finally {
sc.close();
}
}
private static boolean isRestrationCode(int code, char[] cArrays, int start) {
if ((cArrays[start + 1] - code) == 'h') {
if ((cArrays[start + 2] - code) == 'e') {
return true;
} else if ((cArrays[start + 2] - code) == 'i') {
if ((cArrays[start + 3] - code) == 's') {
return true;
}
} else if ((cArrays[start + 2] - code) == 'a') {
if ((cArrays[start + 3] - code) == 't') {
return true;
}
}
}
return false;
}
private static char[] displace(int code, char[] originalCharactors) {
char[] targetCharactors = new char[originalCharactors.length];
int i = 0;
for (char c : originalCharactors) {
if (c >= 97 && c <= 122) {
c -= code;
}
targetCharactors[i] = (char) c;
i++;
}
return targetCharactors;
}
private static void print(char[] cArrays) {
StringBuilder sb = new StringBuilder();
for (char c : cArrays) {
sb.append(c);
}
System.out.println(sb.toString());
}
|
Main.java:75: error: reached end of file while parsing
}
^
1 error
|
s877696345
|
p00017
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
private static int[][] charaint;
public static void main(String[]args)throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str=br.readLine();
while(str!=null){
String[]wordstr=str.split(" ",0);
for(int i=0;i<wordstr.length;i++){
char[][]chara=new char[wordstr.length][wordstr[i].length()];
charaint=new int[wordstr.length][wordstr[i].length()];
chara[i]=wordstr[i].toCharArray();
for(int j=0;j<chara[i].length;j++){
charaint[i][j]=(int)chara[i][j];
}
}
int shift=Search(charaint);
Print(shift,charaint);
str=br.readLine();
}
}
private static int Search(int[][]ch){
for(int i=0;i<ch.length;i++){
if(ch[i].length==3){
for(int k=0;k<26;k++){
int a=97+((ch[i][0]-97+k)%26);
int b=97+((ch[i][1]-97+k)%26);
int c=97+((ch[i][2]-97+k)%26);
if(a==116&&b==104&&c==101){
return k;
}
}
}else if(ch[i].length==4){
for (int k=0;k<26;k++){
int a=97+((ch[i][0]-97+k)%26);
int b=97+((ch[i][1]-97+k)%26);
int c=97+((ch[i][2]-97+k)%26);
int d=97+((ch[i][3]-97+k)%26);
if((a==116&&b==104&&c==105&&d==115)||(a==116&&b==104&&c==97&&d==116)){
return k;
}
}
}
}
}
private static void Print(int n,int[][]ch){
for (int i=0;i<ch.length;i++){
for (int j=0;j<ch[i].length;j++){
System.out.print((char)(97+((ch[i][j]-97+n)%26)));
}
if(i!=ch.length-1){
System.out.print(" ");
}
}
}
}
|
Main.java:47: error: missing return statement
}
^
1 error
|
s618246899
|
p00017
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
String line = scan.nextLine();
for(int i = 0; i < 26; i++){
String now = "";
StringBuffer sb = new StringBuffer();
for(int j = 0; j < line.length(); j++){
char cz = line.charAt(j);
if(cz >= 'a' && cz <= 'z'){
char cs = (char)('a' + (cz - 'a' - i) % 26);
} else{
char cs = cz;
}
sb.append(cs);
}
now = sb.toString();
boolean flag = false;
for(int j = 0; j < now.length()- 2; j++){
if(now.charAt(j) == 't' && now.charAt(j + 1) == 'h'
&& now.charAt(j + 2) == 'e'){
flag = true;
}
}
for(int j = 0; j < now.length() - 3; j++){
if(now.charAt(j) == 't' && now.charAt(j + 1) == 'h'){
if(now.charAt(j + 2) == 'i'
&& now.charAt(j + 3) == 's'){
flag = true;
}
if(now.charAt(j + 2) == 'a'
&& now.charAt(j + 3) == 't'){
flag = true;
}
}
}
if(flag){
System.out.printf("%s\n", now);
break;
}
}
}
}
|
Main.java:48: error: reached end of file while parsing
}
^
1 error
|
s424645123
|
p00017
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
String line = scan.nextLine();
for(int i = 0; i < 26; i++){
String now = "";
StringBuffer sb = new StringBuffer();
for(int j = 0; j < line.length(); j++){
char cz = line.charAt(j);
if(cz >= 'a' && cz <= 'z'){
char cs = (char)('a' + (cz - 'a' - i) % 26);
} else{
char cs = cz;
}
sb.append(cs);
}
now = sb.toString();
boolean flag = false;
for(int j = 0; j < now.length()- 2; j++){
if(now.charAt(j) == 't' && now.charAt(j + 1) == 'h'
&& now.charAt(j + 2) == 'e'){
flag = true;
}
}
for(int j = 0; j < now.length() - 3; j++){
if(now.charAt(j) == 't' && now.charAt(j + 1) == 'h'){
if(now.charAt(j + 2) == 'i'
&& now.charAt(j + 3) == 's'){
flag = true;
}
if(now.charAt(j + 2) == 'a'
&& now.charAt(j + 3) == 't'){
flag = true;
}
}
}
if(flag){
System.out.printf("%s\n", now);
break;
}
}
}
}
|
Main.java:48: error: reached end of file while parsing
}
^
1 error
|
s149974894
|
p00017
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
String line = scan.nextLine();
for(int i = 0; i < 26; i++){
String now = "";
StringBuffer sb = new StringBuffer();
for(int j = 0; j < line.length(); j++){
char cz = line.charAt(j);
if(cz >= 'a' && cz <= 'z'){
char cs = (char)('a' + (cz - 'a' + i) % 26);
} else{
char cs = cz;
}
sb.append(cs);
}
now = sb.toString();
boolean flag = false;
for(int j = 0; j < now.length()- 2; j++){
if(now.charAt(j) == 't' && now.charAt(j + 1) == 'h'
&& now.charAt(j + 2) == 'e'){
flag = true;
}
}
for(int j = 0; j < now.length() - 3; j++){
if(now.charAt(j) == 't' && now.charAt(j + 1) == 'h'){
if(now.charAt(j + 2) == 'i'
&& now.charAt(j + 3) == 's'){
flag = true;
}
if(now.charAt(j + 2) == 'a'
&& now.charAt(j + 3) == 't'){
flag = true;
}
}
}
if(flag){
System.out.printf("%s\n", now);
break;
}
}
}
}
|
Main.java:48: error: reached end of file while parsing
}
^
1 error
|
s448169301
|
p00017
|
Java
|
import java.util.*;
public class MainA{
private static final Scanner scan = new Scanner(System.in);
static int dd = 0;
public static void main(String[] args){
String theS = "the";
String thisS = "this";
String thatS = "that";
String[] theZ = changeCip(theS);
String[] thisZ = changeCip(thisS);
String[] thatZ = changeCip(thatS);
/* for(int i = 0; i < 26; i++){
System.out.printf("%s\n", theZ[i]);
} */
String cipLine = readCip();
boolean flag = false;
boolean flag2 = false;
flag = seekWord(cipLine, theZ);
flag2 = seekWord(cipLine, thisZ, thatZ);
if(flag == true || flag2 == true){
String stLine = backCip(cipLine);
System.out.printf("%s\n", stLine);
}
}
public static String[] changeCip(String str){
String[] changeZ = new String[26];
for(int h = 0; h < 26; h++){
StringBuffer sb = new StringBuffer();
for(int i = 0; i < str.length(); i++){
char cs = str.charAt(i);
char cz = (char)('a' + (cs - 'a' + h) % 26);
sb.append(cz);
}
changeZ[h] = sb.toString();
}
return changeZ;
}
public static String readCip(){
String line = scan.nextLine();
return line;
}
public static boolean seekWord(String str, String[] stArr1){
boolean flag = false;
for(int i = 0; i < str.length() - 2; i++){
char ch = str.charAt(i);
char ch1 = str.charAt(i + 1);
char ch2 = str.charAt(i + 2);
for(int j = 0; j < 26; j++){
char cz =stArr1[j].charAt(0);
char cz1 = stArr1[j].charAt(1);
char cz2 = stArr1[j].charAt(2);
if(ch == cz && ch1 == cz1 && ch2 == cz2){
dd = j;
flag = true;
break;
}
}
}
return flag;
}
public static boolean seekWord(String str, String[] stArr1, String[] stArr2){
boolean flag = false;
for(int i = 0; i < str.length() - 3; i++){
char ch = str.charAt(i);
char ch1 = str.charAt(i + 1);
char ch2 = str.charAt(i + 2);
char ch3 = str.charAt(i + 3);
for(int j = 0; j < 26; j++){
char cx = stArr1[j].charAt(0);
char cx1 = stArr1[j].charAt(1);
char cx2 = stArr1[j].charAt(2);
char cx3 = stArr1[j].charAt(3);
char cy = stArr2[j].charAt(0);
char cy1 = stArr2[j].charAt(1);
char cy2 = stArr2[j].charAt(2);
char cy3 = stArr2[j].charAt(3);
if(ch == cx && ch1 == cx1 && ch2 == cx2 && ch3 == cx3){
dd = j;
flag = true;
break;
}
if(ch == cy && ch1 == cy1 && ch2 == cy2 && ch3 == cy3){
dd = j;
flag = true;
break;
}
}
}
return flag;
}
public static String backCip(String str){
StringBuffer sb = new StringBuffer();
for(int i = 0; i < str.length() ; i++){
char cz = str.charAt(i);
if(cz >= 'a' && cz <= 'z'){
char cs = (char)('a' + (cz - dd - 'a') % 26);
sb.append(cs);
} else{
char cs = cz;
sb.append(cs);
}
}
String back = sb.toString();
return back;
}
}
|
Main.java:3: error: class MainA is public, should be declared in a file named MainA.java
public class MainA{
^
1 error
|
s038154315
|
p00017
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
String cipLine = scan.nextLine();
for(int i = 0; i < 26; i++){
StringBuffer sb = new StringBuffer();
for(int j = 0; j < cipLine.length(); j++){
char cz = cipLine.charAt(j);
if(cz >= 'a' && cz <= 'z'){
sb.append((char)('a' + (cz - 'a' + i) % 26));
} else{
sb.append(cz);
}
}
String now = sb.toString();
boolean flag = false;
for(int j = 0; j < now.length() - 2; j++){
if(j > 0){
char cm = now.charAt(j - 1);
if(cm >= 'a' && cm <= 'z'){
flag = false;
continue;
}
char cs = now.chatAt(j);
char cs1 = now.charAt(j + 1);
char cs2 = now.charAt(j + 2);
if(cs == 't' && cs1 == 'h' && cs2 == 'e'){
flag = true;
break;
}
} else{
char cs = now.charAt(j);
char cs1 = now.charAt(j + 1);
char cs2 = now.chatAt(j + 2);
if(cs == 't' && cs1 == 'h' && cs2 == 'e'){
flag = true;
break;
}
}
}
for(int j = 0; now.length() - 3; j++){
if(j > 0){
char cm = now.chatAt(j - 1);
if(cm >= 'a' && cm <= 'z'){
flag = false;
continue;
}
char cs = now.charAt(j);
char cs1 = now.charAt(j + 1);
char cs2 = now.charAt(j + 2);
char cs3 = now.charAt(j + 3);
if(cs == 't' && cs1 == 'h'){
if(cs2 == 'i' && cs3 == 's'){
flag = true;
break;
}
if(cs2 == 'a' && cs3 == 't'){
flag = true;
break;
}
}
} else{
char cs = now.charAt(j);
char cs1 = now.charAt(j + 1);
char cs2 = now.charAt(j + 2);
char cs3 = now.charAt(j + 3);
if(cs == 't' && cs1 == 'h'){
if(cs2 == 'i' && cs3 == 's'){
flag = true;
break;
}
if(cs2 == 'a' && cs3 == 't'){
flag = true;
break;
}
}
}
}
if(flag){
System.out.printf("%s\n", now);
break;
}
}
}
}
}
|
Main.java:29: error: cannot find symbol
char cs = now.chatAt(j);
^
symbol: method chatAt(int)
location: variable now of type String
Main.java:39: error: cannot find symbol
char cs2 = now.chatAt(j + 2);
^
symbol: method chatAt(int)
location: variable now of type String
Main.java:46: error: incompatible types: int cannot be converted to boolean
for(int j = 0; now.length() - 3; j++){
^
Main.java:48: error: cannot find symbol
char cm = now.chatAt(j - 1);
^
symbol: method chatAt(int)
location: variable now of type String
4 errors
|
s448651904
|
p00017
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
String cipLine = scan.nextLine();
for(int i = 0; i < 26; i++){
StringBuffer sb = new StringBuffer();
for(int j = 0; j < cipLine.length(); j++){
char cz = cipLine.charAt(j);
if(cz >= 'a' && cz <= 'z'){
sb.append((char)('a' + (cz - 'a' + i) % 26));
} else{
sb.append(cz);
}
}
String now = sb.toString();
boolean flag = false;
for(int j = 0; j < now.length() - 2; j++){
if(j > 0){
char cm = now.charAt(j - 1);
if(cm >= 'a' && cm <= 'z'){
flag = false;
continue;
}
char cs = now.charAt(j);
char cs1 = now.charAt(j + 1);
char cs2 = now.charAt(j + 2);
if(cs == 't' && cs1 == 'h' && cs2 == 'e'){
flag = true;
break;
}
} else{
char cs = now.charAt(j);
char cs1 = now.charAt(j + 1);
char cs2 = now.charAt(j + 2);
if(cs == 't' && cs1 == 'h' && cs2 == 'e'){
flag = true;
break;
}
}
}
for(int j = 0; now.length() - 3; j++){
if(j > 0){
char cm = now.charAt(j - 1);
if(cm >= 'a' && cm <= 'z'){
flag = false;
continue;
}
char cs = now.charAt(j);
char cs1 = now.charAt(j + 1);
char cs2 = now.charAt(j + 2);
char cs3 = now.charAt(j + 3);
if(cs == 't' && cs1 == 'h'){
if(cs2 == 'i' && cs3 == 's'){
flag = true;
break;
}
if(cs2 == 'a' && cs3 == 't'){
flag = true;
break;
}
}
} else{
char cs = now.charAt(j);
char cs1 = now.charAt(j + 1);
char cs2 = now.charAt(j + 2);
char cs3 = now.charAt(j + 3);
if(cs == 't' && cs1 == 'h'){
if(cs2 == 'i' && cs3 == 's'){
flag = true;
break;
}
if(cs2 == 'a' && cs3 == 't'){
flag = true;
break;
}
}
}
}
if(flag){
System.out.printf("%s\n", now);
break;
}
}
}
}
}
|
Main.java:46: error: incompatible types: int cannot be converted to boolean
for(int j = 0; now.length() - 3; j++){
^
1 error
|
s772801463
|
p00017
|
Java
|
import java.util.*;
public class Vol0_17aa{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
String cipLine = scan.nextLine();
for(int i = 0; i < 26; i++){
StringBuffer sb = new StringBuffer();
for(int j = 0; j < cipLine.length(); j++){
char cz = cipLine.charAt(j);
if(cz >= 'a' && cz <= 'z'){
sb.append((char)('a' + (cz - 'a' + i) % 26));
} else{
sb.append(cz);
}
}
String now = sb.toString();
boolean flag = false;
for(int j = 0; j < now.length() - 2; j++){
if(j > 0){
char cm = now.charAt(j - 1);
if(cm >= 'a' && cm <= 'z'){
flag = false;
continue;
}
}
char cs = now.charAt(j);
char cs1 = now.charAt(j + 1);
char cs2 = now.charAt(j + 2);
if(cs == 't' && cs1 == 'h' && cs2 == 'e'){
flag = true;
break;
}
}
for(int j = 0;j < now.length() - 3; j++){
if(j > 0){
char cm = now.charAt(j - 1);
if(cm >= 'a' && cm <= 'z'){
flag = false;
continue;
}
}
char cs = now.charAt(j);
char cs1 = now.charAt(j + 1);
char cs2 = now.charAt(j + 2);
char cs3 = now.charAt(j + 3);
if(cs == 't' && cs1 == 'h'){
if(cs2 == 'i' && cs3 == 's'){
flag = true;
break;
}
if(cs2 == 'a' && cs3 == 't'){
flag = true;
break;
}
}
}
if(flag){
System.out.printf("%s\n", now);
break;
}
}
}
}
}
|
Main.java:3: error: class Vol0_17aa is public, should be declared in a file named Vol0_17aa.java
public class Vol0_17aa{
^
1 error
|
s361855477
|
p00017
|
Java
|
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
String text = sc.next();
String retext = "";
for(int i=0; i<28; i++){
retext = retext+String.valueof((char)(text.charAt(i) -no));
if(retext.indexof("the") !=1){
System.out.println(retext);
break;
}else if(retext.indexof("this") !=1){
System.out.println(retext);
break;
}else if(retext.indexof("that") !=1){
System.out.println(retext);
break;
}else{
}
}
}
}
|
Main.java:10: error: cannot find symbol
retext = retext+String.valueof((char)(text.charAt(i) -no));
^
symbol: variable no
location: class Main
Main.java:10: error: cannot find symbol
retext = retext+String.valueof((char)(text.charAt(i) -no));
^
symbol: method valueof(char)
location: class String
Main.java:11: error: cannot find symbol
if(retext.indexof("the") !=1){
^
symbol: method indexof(String)
location: variable retext of type String
Main.java:14: error: cannot find symbol
}else if(retext.indexof("this") !=1){
^
symbol: method indexof(String)
location: variable retext of type String
Main.java:17: error: cannot find symbol
}else if(retext.indexof("that") !=1){
^
symbol: method indexof(String)
location: variable retext of type String
5 errors
|
s481249287
|
p00017
|
Java
|
import java.io.*;
public class Aoj0017CaesarCipher {
public static void main(String[] args) throws IOException{
try{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String str;
String target[];
int tmp1 = 99;
int tmp2 = 99;
int tmp3 = 99;
int caesar;
while( (str = br.readLine()) != null){
caesar = 0;
target = str.split(" ");
for(int i = 0; i < target.length; i++){
tmp1 = isThe(target[i]);
tmp2 = isThis(target[i]);
tmp3 = isThat(target[i]);
if( tmp1 != 99){
caesar = tmp1;
break;
}else if( tmp2 != 99){
caesar = tmp2;
break;
}else if( tmp3 != 99){
caesar = tmp3;
break;
}
}
StringBuilder result = new StringBuilder();
for(int i = 0; i < target.length; i++){
result.append(caeserString(target[i],caesar));
result.append(" ");
}
System.out.println(result);
}
}catch(Exception e){
System.out.println(e);
}
}
private static int isThe(String str){
String newStr;
String target = "the";
int result = 99;;
if(str.length() != target.length()) return result;
for(int i = -26; i < 27; i++){
//str.charAt(j)???str???j????????????????????????
newStr = String.valueOf((char)(str.charAt(0)+i))
+ String.valueOf((char)(str.charAt(1)+i))
+ String.valueOf((char)(str.charAt(2)+i));
if( newStr.equals(target) ){
result = i;
break;
}
}
return result;
}
private static int isThis(String str){
String newStr;
String target = "this";
int result = 99;;
if(str.length() != target.length()) return result;
for(int i = -26; i < 27; i++){
//str.charAt(j)???str???j????????????????????????
newStr = String.valueOf((char)(str.charAt(0)+i))
+ String.valueOf((char)(str.charAt(1)+i))
+ String.valueOf((char)(str.charAt(2)+i))
+ String.valueOf((char)(str.charAt(3)+i));
if( newStr.equals(target) ){
result = i;
break;
}
}
return result;
}
private static int isThat(String str){
String newStr;
String target = "that";
int result = 99;;
if(str.length() != target.length()) return result;
for(int i = -26; i < 27; i++){
//str.charAt(j)???str???j????????????????????????
newStr = String.valueOf((char)(str.charAt(0)+i))
+ String.valueOf((char)(str.charAt(1)+i))
+ String.valueOf((char)(str.charAt(2)+i))
+ String.valueOf((char)(str.charAt(3)+i));
if( newStr.equals(target) ){
result = i;
break;
}
}
return result;
}
private static String caeserString(String str,int n){
String result = "";
for(int i = 0; i < str.length(); i++){
if( (str.charAt(i)) == ".".charAt(0)){
result += String.valueOf((char)(str.charAt(i)));
continue;
}
result += String.valueOf((char)(str.charAt(i)+n));
}
return result;
}
}
|
Main.java:3: error: class Aoj0017CaesarCipher is public, should be declared in a file named Aoj0017CaesarCipher.java
public class Aoj0017CaesarCipher {
^
1 error
|
s890780953
|
p00017
|
Java
|
import java.io.*;
public class main{
public static void main(String[] args) throws IOException{
try{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String str;
String target[];
int checkResult = 99;
int caesar;
while( (str = br.readLine()) != null){
caesar = 0;
target = str.split(" ");
for(int i = 0; i < target.length; i++){
checkResult = checkPattern(target[i]);
if(checkResult != 99){
caesar = checkResult;
break;
}
}
StringBuilder result = new StringBuilder();
for(int i = 0; i < target.length; i++){
result.append(makeCaeserString(target[i],caesar));
result.append(" ");
}
System.out.println(result);
}
}catch(Exception e){
System.out.println(e);
}
}
private static int checkPattern(String str){
String target[];
target = str.split("\\.");
int result = 99;
for(int i = 0; i < target.length; i++){
result = isThe(target[i]);
if(result != 99) break;
result = isThis(target[i]);
if(result != 99) break;
result = isThat(target[i]);
if(result != 99) break;
}
return result;
}
private static int isThe(String str){
String newStr;
String target = "the";
int result = 99;
if(str.length() != target.length()) return result;
for(int i = -26; i < 27; i++){
//str.charAt(j)???str???j????????????????????????
newStr = String.valueOf((char)(str.charAt(0)+i))
+ String.valueOf((char)(str.charAt(1)+i))
+ String.valueOf((char)(str.charAt(2)+i));
if( newStr.equals(target) ){
result = i;
break;
}
}
return result;
}
private static int isThis(String str){
String newStr;
String target = "this";
int result = 99;;
if(str.length() != target.length()) return result;
for(int i = -26; i < 27; i++){
//str.charAt(j)???str???j????????????????????????
newStr = String.valueOf((char)(str.charAt(0)+i))
+ String.valueOf((char)(str.charAt(1)+i))
+ String.valueOf((char)(str.charAt(2)+i))
+ String.valueOf((char)(str.charAt(3)+i));
if( newStr.equals(target) ){
result = i;
break;
}
}
return result;
}
private static int isThat(String str){
String newStr;
String target = "that";
int result = 99;;
if(str.length() != target.length()) return result;
for(int i = -26; i < 27; i++){
//str.charAt(j)???str???j????????????????????????
newStr = String.valueOf((char)(str.charAt(0)+i))
+ String.valueOf((char)(str.charAt(1)+i))
+ String.valueOf((char)(str.charAt(2)+i))
+ String.valueOf((char)(str.charAt(3)+i));
if( newStr.equals(target) ){
result = i;
break;
}
}
return result;
}
private static String makeCaeserString(String str,int n){
int intA = 'a';
int intZ = 'z';
int zure = 0;
String result = "";
for(int i = 0; i < str.length(); i++){
if(str.charAt(i)<intA || str.charAt(i) > intZ){
return str;
}else if( (str.charAt(i)) == ".".charAt(0)){
zure = -n;
}else if( str.charAt(i) + n < intA ){
zure = 26;
}else if(str.charAt(i) + n > intZ){
zure = -26;
}
result += String.valueOf((char)(str.charAt(i)+n+zure));
zure = 0;
}
return result;
}
}
|
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s960886092
|
p00017
|
Java
|
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
static char cnvChar[] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
public static void main (String[] args) throws java.lang.Exception
{
//文字列読込み
Scanner sc = new Scanner(System.in);
//取得
String scLline = sc.nextLine(); //1行取得
//System.out.println(scLline); //debug
//分割
String[] inTxt = scLline.split("[\\s]+"); //空白で区切る
int len = inTxt.length;
int shift;
for (int i = 0; i < len; i++) {
int[] chrs = new int[4];
int[] diff = new int[3];
for (int j= 0; j < inTxt[i].length(); j++) {
if (j > 3) {
continue; //4文字以上はいらない
}
chrs[j] = cnvEtoN(inTxt[i].charAt(j));
//System.out.print(chrs[j]);
}
//System.out.print(" ");
diff[0] = chrs[1] - chrs[0];
diff[1] = chrs[2] - chrs[1];
diff[2] = chrs[3] - chrs[2];
//the 21,9,6 -12, -3
// 15, 24
//this 21,9,10,20 -12, 1, 10
// 15, -26, -17
//that 21,9,1,21 -12,-8, 20
// 15, 19, -7
// T>Hか
boolean ok = false;
if (diff[0] = -12 || diff[0] = 15) {
if (diff[1] == -3 || diff[1] == 24) {
//the
ok = true;
}
if ((diff[1] == 1 || diff[1] == -26) &&
(diff[2] == 10 || diff[2] == -17)) {
//this
ok = true;
}
if ((diff[1] == -8 || diff[1] == 19) &&
(diff[2] == 20 || diff[2] == -7)) {
//that
ok = true;
}
}
if (ok == true) {
int result = chrs[0] - 19;
//System.out.print("[");
//System.out.print(inTxt[i] + ">");
//System.out.print(cnvNtoE(chrs[0] - result));
//System.out.print(cnvNtoE(chrs[1] - result));
//System.out.print(cnvNtoE(chrs[2] - result));
//System.out.print(cnvNtoE(chrs[3] - result));
//System.out.println(result + "]");
//答え出力
for (int k = 0; k < scLline.length(); k++) {
char tmp = scLline.charAt(k);
if (cnvEtoN(tmp) > 0) {
char res = cnvNtoE(cnvEtoN(tmp) - result);
System.out.print(res);
} else {
System.out.print(tmp);
}
}
System.out.println("");
return;
}
}
}
public static char cnvNtoE(int val) {
if (val > 26) {
return cnvChar[val - 26];
}
if (val < 0) {
return cnvChar[val + 26];
}
return cnvChar[val];
}
public static int cnvEtoN(char val) {
try {
for (int i = 0; i < cnvChar.length; i++) {
if (cnvChar[i] == val) {
return i;
}
}
return -1;
} catch (Exception ex) {
return -1;
}
}
}
|
Main.java:56: error: bad operand types for binary operator '||'
if (diff[0] = -12 || diff[0] = 15) {
^
first type: int
second type: int
Main.java:56: error: incompatible types: int cannot be converted to boolean
if (diff[0] = -12 || diff[0] = 15) {
^
2 errors
|
s552014761
|
p00017
|
Java
|
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
static char cnvChar[] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
public static void main (String[] args) throws java.lang.Exception
{
//文字列読込み
Scanner sc = new Scanner(System.in);
//取得
String scLline = sc.nextLine(); //1行取得
//System.out.println(scLline); //debug
//分割
String[] inTxt = scLline.split("[\\s]+"); //空白で区切る
int len = inTxt.length;
int shift;
for (int i = 0; i < len; i++) {
int[] chrs = new int[4];
int[] diff = new int[3];
for (int j= 0; j < inTxt[i].length(); j++) {
if (j > 3) {
continue; //4文字以上はいらない
}
chrs[j] = cnvEtoN(inTxt[i].charAt(j));
//System.out.print(chrs[j]);
}
//System.out.print(" ");
diff[0] = chrs[1] - chrs[0];
diff[1] = chrs[2] - chrs[1];
diff[2] = chrs[3] - chrs[2];
//the 21,9,6 -12, -3
// 15, 24
//this 21,9,10,20 -12, 1, 10
// 15, -26, -17
//that 21,9,1,21 -12,-8, 20
// 15, 19, -7
// T>Hか
boolean ok = false;
if (diff[0] = -12 || diff[0] = 15) {
if (diff[1] == -3 || diff[1] == 24) {
//the
ok = true;
}
if ((diff[1] == 1 || diff[1] == -26) && (diff[2] == 10 || diff[2] == -17)) {
//this
ok = true;
}
if ((diff[1] == -8 || diff[1] == 19) && (diff[2] == 20 || diff[2] == -7)) {
//that
ok = true;
}
}
if (ok == true) {
int result = chrs[0] - 19;
//System.out.print("[");
//System.out.print(inTxt[i] + ">");
//System.out.print(cnvNtoE(chrs[0] - result));
//System.out.print(cnvNtoE(chrs[1] - result));
//System.out.print(cnvNtoE(chrs[2] - result));
//System.out.print(cnvNtoE(chrs[3] - result));
//System.out.println(result + "]");
//答え出力
for (int k = 0; k < scLline.length(); k++) {
char tmp = scLline.charAt(k);
if (cnvEtoN(tmp) > 0) {
char res = cnvNtoE(cnvEtoN(tmp) - result);
System.out.print(res);
} else {
System.out.print(tmp);
}
}
System.out.println("");
return;
}
}
}
public static char cnvNtoE(int val) {
if (val > 26) {
return cnvChar[val - 26];
}
if (val < 0) {
return cnvChar[val + 26];
}
return cnvChar[val];
}
public static int cnvEtoN(char val) {
try {
for (int i = 0; i < cnvChar.length; i++) {
if (cnvChar[i] == val) {
return i;
}
}
return -1;
} catch (Exception ex) {
return -1;
}
}
}
|
Main.java:56: error: bad operand types for binary operator '||'
if (diff[0] = -12 || diff[0] = 15) {
^
first type: int
second type: int
Main.java:56: error: incompatible types: int cannot be converted to boolean
if (diff[0] = -12 || diff[0] = 15) {
^
2 errors
|
s769032082
|
p00017
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Pattern;
public class Test{
public static void main(String[] args){
Pattern pattern = Pattern.compile("this|that|the");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String buffer;
try{
while ((buffer = br.readLine()) != null) {
//暗号解読部
char[] cipher = buffer.toCharArray();
//暗号解読に正解していれば、解読文を表示
//全ての文字を、ひとつ後ろの文字にずらす(例:a→b,z→a)
for(int i=0;!pattern.matcher(String.valueOf(cipher)).find() & i < 25;i++){
for(int j=0;j < cipher.length;j++){
if(97 <= cipher[j] && cipher[j] <= 121){
cipher[j]++;
}else if(cipher[j] == 122){
cipher[j] = 97;
}
}
}
System.out.println(cipher);
}
}catch(IOException e){
System.out.println(e);
}
}
}
|
Main.java:6: error: class Test is public, should be declared in a file named Test.java
public class Test{
^
1 error
|
s445086495
|
p00017
|
Java
|
<?php
$kw = array('the', 'this', 'that');
while (TRUE) {
$s = rtrim(fgets(STDIN));
if (feof(STDIN)) {
break;
}
for ($i = 0; $i < 26; $i++) {
$words = explode(' ', str_replace('.', '', $s));
foreach ($kw as $v) {
if (in_array($v, $words)) {
echo $s . PHP_EOL;
continue 3;
}
}
for ($j = 0; $j < strlen($s); $j++) {
if ($s[$j] < 'a' || $s[$j] > 'z') {
continue;
}
if ($s[$j] === 'z') {
$s[$j] = 'a';
} else {
$s[$j] = chr(ord($s[$j]) + 1);
}
}
}
}
|
Main.java:1: error: class, interface, enum, or record expected
<?php
^
Main.java:3: error: unclosed character literal
$kw = array('the', 'this', 'that');
^
Main.java:3: error: unclosed character literal
$kw = array('the', 'this', 'that');
^
Main.java:3: error: unclosed character literal
$kw = array('the', 'this', 'that');
^
Main.java:3: error: unclosed character literal
$kw = array('the', 'this', 'that');
^
Main.java:3: error: unclosed character literal
$kw = array('the', 'this', 'that');
^
Main.java:3: error: unclosed character literal
$kw = array('the', 'this', 'that');
^
Main.java:4: error: class, interface, enum, or record expected
while (TRUE) {
^
Main.java:6: error: class, interface, enum, or record expected
if (feof(STDIN)) {
^
Main.java:8: error: class, interface, enum, or record expected
}
^
Main.java:9: error: class, interface, enum, or record expected
for ($i = 0; $i < 26; $i++) {
^
Main.java:9: error: class, interface, enum, or record expected
for ($i = 0; $i < 26; $i++) {
^
Main.java:10: error: empty character literal
$words = explode(' ', str_replace('.', '', $s));
^
Main.java:11: error: class, interface, enum, or record expected
foreach ($kw as $v) {
^
Main.java:14: error: class, interface, enum, or record expected
continue 3;
^
Main.java:15: error: class, interface, enum, or record expected
}
^
Main.java:17: error: class, interface, enum, or record expected
for ($j = 0; $j < strlen($s); $j++) {
^
Main.java:17: error: class, interface, enum, or record expected
for ($j = 0; $j < strlen($s); $j++) {
^
Main.java:20: error: class, interface, enum, or record expected
}
^
Main.java:23: error: class, interface, enum, or record expected
} else {
^
Main.java:25: error: class, interface, enum, or record expected
}
^
21 errors
|
s063474869
|
p00017
|
Java
|
import java.io.*;
import java.util.Scanner;
public class CaesarChipher {
public static String decode (String str) {
String ret = "";
for (int i = 1; i <= 25; i++) {
boolean flag = false;
for (String s : str.split(" ")) {
if (s.charAt(s.length() - 1) == '.')
s = s.substring(0,s.length() - 1);
String temp = "";
for (int j = 0; j < s.length(); j++)
temp += (char)((str.charAt(j) - 'a' + i) % 26 + 'a');
if (temp.matches("the|that|this"))
flag = true;
ret += temp;
}
if (flag) {
return ret;
}
ret = "";
}
return null;
}
public static void main (String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
String str = sc.nextLine();
if (str == null) break;
System.out.println(decode(str));
}
}
}
|
Main.java:4: error: class CaesarChipher is public, should be declared in a file named CaesarChipher.java
public class CaesarChipher {
^
1 error
|
s756878151
|
p00017
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Pattern;
public class Main{
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Pattern ptr = Pattern.compile("this|that|the");
String str;
while((str=br.readLine())!=null){
char charArray[] = str.toCharArray();
for(int i=0; !ptr.matcher(String.valueOf(charArray)).find() & i<26; i++){
for(int j=0; j<charArray.length; j++){
if('a'<=charArray[j] && charArray[j] < 'z'){
charArray[j]++;
}else if(charArray[j]=='z'){
charArray[j] = 'a';
}
}
}
System.out.println(charArray);
}
}
|
Main.java:27: error: reached end of file while parsing
}
^
1 error
|
s096621006
|
p00017
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Pattern;
public class CaesarChipher {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Pattern ptr = Pattern.compile("this|that|the");
String str;
while((str=br.readLine())!=null){
char charArray[] = str.toCharArray();
for(int i=0; !ptr.matcher(String.valueOf(charArray)).find() & i<26; i++){
for(int j=0; j<charArray.length; j++){
if('a'<=charArray[j] && charArray[j] < 'z'){
charArray[j]++;
}else if(charArray[j]=='z'){
charArray[j] = 'a';
}
}
}
System.out.println(charArray);
}
}
}
|
Main.java:7: error: class CaesarChipher is public, should be declared in a file named CaesarChipher.java
public class CaesarChipher {
^
1 error
|
s487148469
|
p00017
|
Java
|
import java.util.*;
public class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
ArrayList<String> strlist = new ArrayList<String>();
while (scanner.hasNext()) {
strlist.add(scanner.next());
}
int number = calcNumber(strlist);
StringBuilder decoded = decode(strlist, number);
System.out.printa(decoded);
}
public static int calcNumber(ArrayList<String> strlist) {
HashMap<Integer, Integer> count = new HashMap<Integer, Integer>();
int number = 0;
int maxCount = 0;
for (String word : strlist) {
if (word.length() == 3 || word.length() == 4) {
char first = word.charAt(0);
int diff = 't' - first;
int counter = 1;
if (count.containsKey(diff)) {
counter = count.get(diff) + 1;
}
count.put(diff, counter);
if (counter > maxCount) {
maxCount = counter;
number = diff;
}
}
}
return number;
}
public static StringBuilder decode(ArrayList<String> strlist, int number) {
StringBuilder decoded = new StringBuilder();
for (String word : strlist) {
for (int i = 0; i < word.length(); i++) {
char c = word.charAt(i);
if ( c != '.') {
c += number;
}
decoded.append(c);
}
decoded.append(" ");
}
decoded.deleteCharAt(decoded.length()-1);
return decoded;
}
}
|
Main.java:17: error: cannot find symbol
System.out.printa(decoded);
^
symbol: method printa(StringBuilder)
location: variable out of type PrintStream
1 error
|
s308078340
|
p00017
|
C
|
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int i;
char s[80];
while(gets(s)!=EOF){
for(i=0;i<=79;i++){
if(s[i]=='\0'){
break;
}
if(isalpha(s[i])!=false){
s[i]-=4;
}
}
puts(s);
return 0;
}
}
|
main.c: In function 'main':
main.c:9:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
9 | while(gets(s)!=EOF){
| ^~~~
| fgets
main.c:14:35: error: 'false' undeclared (first use in this function)
14 | if(isalpha(s[i])!=false){
| ^~~~~
main.c:5:1: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
4 | #include <stdlib.h>
+++ |+#include <stdbool.h>
5 |
main.c:14:35: note: each undeclared identifier is reported only once for each function it appears in
14 | if(isalpha(s[i])!=false){
| ^~~~~
|
s713208216
|
p00017
|
C
|
#include <stdio.h>
#include <string.h>
#include <math.h>
//#define DEBUG 1
#define LENGTH 81
char shift_char(char in);
main()
{
char input[LENGTH];
int flag = 1;
gets(input);
int i, j;
while(gets(input) != \0)
{
while(1)
{
if(strstr(input, "the") != NULL || strstr(input, "that") != NULL || strstr(input, "this") != NULL)
{
break;
}
for(i = 0; i < strlen(input); i++)
{
if(islower(input[i]) != 0)
{
input[i] = shift_char(input[i]);
}
}
}
}
printf("%s", input);
return 0;
}
char shift_char(char in)
{
in = in + 1;
if(in == '{')
{
in = in - 26;
}
return in;
}
|
main.c:10:1: error: return type defaults to 'int' [-Wimplicit-int]
10 | main()
| ^~~~
main.c: In function 'main':
main.c:14:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
14 | gets(input);
| ^~~~
| fgets
main.c:16:30: error: stray '\' in program
16 | while(gets(input) != \0)
| ^
main.c:26:36: error: implicit declaration of function 'islower' [-Wimplicit-function-declaration]
26 | if(islower(input[i]) != 0)
| ^~~~~~~
main.c:4:1: note: include '<ctype.h>' or provide a declaration of 'islower'
3 | #include <math.h>
+++ |+#include <ctype.h>
4 |
|
s214524285
|
p00017
|
C
|
#include<string.h>
int main(void){
int i, j, flag, offset;
int lenstr;
char str[100];
for(i = 0 ; i < 100; i++){
str[i] = 0;
}
while(fgets(str, 100, stdin) != NULL){
lenstr = strlen(str);
flag = 0;
for(i = 0; i < lenstr; i++){
if(str[i]>str[i+1]){
if((str[i]-str[i+1])=='t'-'h'){
flag = 1;
}
}else if(str[i]<str[i+1]){
if((str[i]+26)-str[i+1]=='t'-'h'){
flag = 1;
}
}
if(flag){
if((str[i] - 't')>=0){
offset = str[i] - 't';
} else if((str[i] - 't')<0){
offset = str[i] - 't' + 26;
}
for(j = 0; j < lenstr; j++){
if(str[j] == ' ' || str[j] == ',' || str[j] == '.' || str[j] == '\n') continue;
str[j] = str[j] - offset;
}
break;
}
}
if(strstr(str,"the") != NULL || strstr(str,"this") != NULL || strstr(str,"that") != NULL)
printf("%s\n", str);
for(i = 0 ; i < 100; i++){
str[i] = 0;
}
}
return 0;
}
|
main.c: In function 'main':
main.c:13:11: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
13 | while(fgets(str, 100, stdin) != NULL){
| ^~~~~
main.c:13:27: error: 'stdin' undeclared (first use in this function)
13 | while(fgets(str, 100, stdin) != NULL){
| ^~~~~
main.c:2:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
1 | #include<string.h>
+++ |+#include <stdio.h>
2 |
main.c:13:27: note: each undeclared identifier is reported only once for each function it appears in
13 | while(fgets(str, 100, stdin) != NULL){
| ^~~~~
main.c:42:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
42 | printf("%s\n", str);
| ^~~~~~
main.c:42:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:42:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:42:25: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s835437772
|
p00017
|
C
|
#include<stdio.h>
int main(){
int n,i,j,flag,t;
char s[81],ans[81],tmp[81];
scanf("%s",s);
for(i=0,n=0,flag=0;i<26;i++){
for(j=0;s[j]!='\0';j++){
if(!('a'<=s[j]&&s[j]<='z')){
if(tmp[0]=='t'&&tmp[1]=='h'
&&((tmp[2]=='e'&&n==3)
||(tmp[2]=='i'&&tmp[3]=='s'&&n==4)
||(tmp[2]=='a'&&tnp[3]=='t'&&n==4))){
flag=1;
break;
}
n=0;
}else{
t=s[j]+i;
if('a'<=t&&t<='z'){
tmp[n]=t;
}else{
t-='z';
tmp[n]=t+'a'-1;
}
}
}
if(flag)break;
}
if(flag){
//?????????
for(j=0;s[j]!='\0';j++){
t=s[j]+i;
if('a'<=t&&t<='z'){
ans[j]=t;
}else{
t-='z';
ans[j]=t+'a'-1;
}
}
ans[j]='\0';
printf("%s\n",ans);
return 0;
}
|
main.c: In function 'main':
main.c:19:49: error: 'tnp' undeclared (first use in this function); did you mean 'tmp'?
19 | ||(tmp[2]=='a'&&tnp[3]=='t'&&n==4))){
| ^~~
| tmp
main.c:19:49: note: each undeclared identifier is reported only once for each function it appears in
main.c:54:1: error: expected declaration or statement at end of input
54 | }
| ^
|
s101568926
|
p00017
|
C
|
#include<stdio.h>
int main(){
int n,i,j,flag,t;
char s[81],ans[81],tmp[81];
scanf("%s",s);
for(i=0,n=0,flag=0;i<26;i++){
for(j=0;s[j]!='\0';j++){
if(!('a'<=s[j]&&s[j]<='z')){
if(tmp[0]=='t'&&tmp[1]=='h'
&&((tmp[2]=='e'&&n==3)
||(tmp[2]=='i'&&tmp[3]=='s'&&n==4)
||(tmp[2]=='a'&&tmp[3]=='t'&&n==4))){
flag=1;
break;
}
n=0;
}else{
t=s[j]+i;
if('a'<=t&&t<='z'){
tmp[n]=t;
}else{
t-='z';
tmp[n]=t+'a'-1;
}
}
}
if(flag)break;
}
if(flag){
//?????????
for(j=0;s[j]!='\0';j++){
t=s[j]+i;
if('a'<=t&&t<='z'){
ans[j]=t;
}else{
t-='z';
ans[j]=t+'a'-1;
}
}
ans[j]='\0';
printf("%s\n",ans);
return 0;
}
|
main.c: In function 'main':
main.c:54:1: error: expected declaration or statement at end of input
54 | }
| ^
|
s585991323
|
p00017
|
C
|
w#include <stdio.h>
#include <string.h>
int main(){
int i,j;
char s[80];
int len;
while(gets(s)){
len=strlen(s);
for(i=0;i<26;i++){
for(j=0;j<len;j++){
if(s[j]!=' ' && s[j]!='.'){
if(s[j]=='z')s[j]='a';
else s[j]++;
}
}
for(j=0;j<len-4;j++){
if(s[j]=='t' && s[j+1]=='h' && s[j+2]=='e'){printf("%s\n",s);return 0;}
if(s[j]=='t' && s[j+1]=='h' && s[j+2]=='a' && s[j+3]=='t'){printf("%s\n",s);return 0;}
if(s[j]=='t' && s[j+1]=='h' && s[j+2]=='i' && s[j+3]=='s'){printf("%s\n",s);return 0;}
}
if(s[j]=='t' && s[j+1]=='h' && s[j+2]=='e'){printf("%s\n",s);return 0;}
}
}
memset(s,'\0',sizeof(s));
return 0;
}
|
main.c:1:2: error: stray '#' in program
1 | w#include <stdio.h>
| ^
main.c:1:1: error: unknown type name 'w'
1 | w#include <stdio.h>
| ^
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | w#include <stdio.h>
| ^
In file included from main.c:2:
/usr/include/string.h:44:22: error: unknown type name 'size_t'
44 | size_t __n) __THROW __nonnull ((1, 2));
| ^~~~~~
/usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
33 | #include <stddef.h>
+++ |+#include <stddef.h>
34 |
/usr/include/string.h:47:56: error: unknown type name 'size_t'
47 | extern void *memmove (void *__dest, const void *__src, size_t __n)
| ^~~~~~
/usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:55:32: error: unknown type name 'size_t'
55 | int __c, size_t __n)
| ^~~~~~
/usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:61:42: error: unknown type name 'size_t'
61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:64:56: error: unknown type name 'size_t'
64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n)
| ^~~~~~
/usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:80:60: error: unknown type name 'size_t'
80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
| ^~~~~~
/usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:107:48: error: unknown type name 'size_t'
107 | extern void *memchr (const void *__s, int __c, size_t __n)
| ^~~~~~
/usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:145:53: error: unknown type name 'size_t'
145 | const char *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:153:23: error: unknown type name 'size_t'
153 | size_t __n) __THROW __nonnull ((1, 2));
| ^~~~~~
/usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:159:57: error: unknown type name 'size_t'
159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
| ^~~~~~
/usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:166:8: error: unknown type name 'size_t'
166 | extern size_t strxfrm (char *__restrict __dest,
| ^~~~~~
/usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:167:54: error: unknown type name 'size_t'
167 | const char *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:179:8: error: unknown type name 'size_t'
179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
| ^~~~~~
/usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:179:59: error: unknown type name 'size_t'
179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
| ^~~~~~
/usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:195:45: error: unknown type name 'size_t'
195 | extern char *strndup (const char *__string, size_t __n)
| ^~~~~~
/usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:293:8: error: unknown type name 'size_t'
293 | extern size_t strcspn (const char *__s, const char *__reject)
| ^~~~~~
/usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:297:8: error: unknown type name 'size_t'
297 | extern size_t strspn (const char *__s, const char *__accept)
| ^~~~~~
/usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:389:46: error: unknown type name 'size_t'
389 | extern void *memmem (const void *__haystack, size_t __haystacklen,
| ^~~~~~
/usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:390:44: error: unknown type name 'size_t'
390 | const void *__needle, size_t __needlelen)
| ^~~~~~
/usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:398:55: error: unknown type name 'size_t'
398 | const void *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:401:53: error: unknown type name 'size_t'
401 | const void *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:407:8: error: unknown type name 'size_t'
407 | extern size_t strlen (const char *__s)
| ^~~~~~
/usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:413:8: error: unknown type name 'size_t'
413 | extern size_t strnlen (const char *__string, size_t __maxlen)
| ^~~~~~
/usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:413:46: error: unknown type name 'size_t'
413 | extern size_t strnlen (const char *__string, size_t __maxlen)
| ^~~~~~
/usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/string.h:26:
/usr/include/string.h:432:12: error: unknown type name 'size_t'
432 | extern int __REDIRECT_NTH (strerror_r,
| ^~~~~~~~~~~~~~
/usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
In file included from /usr/include/string.h:462:
/usr/include/strings.h:34:54: error: unknown type name 'size_t'
34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n)
| ^~~~~~
/usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
23 | #include <stddef.h>
+++ |+#include <stddef.h>
24 |
/usr/include/strings.h:38:53: error: unknown type name 'size_t'
38 | extern void bcopy (const void *__src, void *__dest, size_t __n)
| ^~~~~~
/usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/strings.h:42:31: error: unknown type name 'size_t'
42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/strings.h:120:61: error: unknown type name 'size_t'
120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
| ^~~~~~
/usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/strings.h:134:27: error: unknown type name 'size_t'
134 | size_t __n, locale_t __loc)
| ^~~~~~
/usr/include/strings.h:134:
|
s932175506
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
char a[85],i;
while(gets(a)!=NULL)
{
for(i=0;a[i]!='\0';i++)
{
if(a[i]>=101&&a[i]<=123)
a[i]=a[i]-4;
else if(a[i]<=100&&a[i]>=97)
a[i]=a[i]+23;
else
a[i]=a[i];
}
printf("%s\n",a);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:11: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
9 | while(gets(a)!=NULL)
| ^~~~
| fgets
main.c:9:18: warning: comparison between pointer and integer
9 | while(gets(a)!=NULL)
| ^~
|
s097765197
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
char s[128];
int i,j,k;
int c;
while((gets(s))!=NULL){
c=1;
for(i=0;i<26;i++){
for(j=0;j<strlen(s);j++){
if(isalpha(s[j])){
if(s[j]=='z'){
s[j]='a';
}else{
s[j]++;
}
}
}
for(k=0;k<strlen(s)-1;k++){
if((s[k]=='t')&&(s[k+1]=='h')){
if(c){
c=0;
printf("%s\n",s);
}
}
}
}
}
return 0;
}
|
main.c: In function 'main':
main.c:10:12: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
10 | while((gets(s))!=NULL){
| ^~~~
| fgets
main.c:10:20: warning: comparison between pointer and integer
10 | while((gets(s))!=NULL){
| ^~
|
s382512658
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
int main()
{
char s[81];
int i;
while(gets(s)){
for(i=0; i<strlen(s); i++){
if(s[i]>='a' && s[i]<='z')
s[i]-=4;
}
puts(s);
}
return 0;
}
|
main.c: In function 'main':
main.c:8:11: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
8 | while(gets(s)){
| ^~~~
| fgets
|
s442201160
|
p00017
|
C
|
#include <stdio.h>
#include<string.h>
int main()
{
char a[200];
int i,b,x,l,c,in;
while(gets(a)!=EOF)
{
l=strlen(a);
b=(int)a[0];
x=116-b;
for(i=0;i<l;i++)
{
if(a[i]>=97&&a[i]<=122)
{
in=(int)a[i];
a[i]=in+x;
}
printf("%c",a[i]);
}
printf("\n");
}
}
|
main.c: In function 'main':
main.c:8:11: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
8 | while(gets(a)!=EOF)
| ^~~~
| fgets
|
s317836858
|
p00017
|
C
|
#include <stdio.h>
#include<string.h>
int main()
{
char a[200];
int i,b,x,l,c,in;
while(gets(a)!=EOF)
{
l=strlen(a);
b=(int)a[0];
x=116-b;
for(i=0;i<l;i++)
{
if(a[i]>=97&&a[i]<=122)
{
in=(int)a[i];
a[i]=in+x;
}
printf("%c",a[i]);
}
printf("\n");}
return 0;
}
|
main.c: In function 'main':
main.c:8:11: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
8 | while(gets(a)!=EOF)
| ^~~~
| fgets
|
s267530201
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
int main()
{
int i,l;
char ch[90];
while(gets(ch)){
l=strlen(ch);
for(i=0;i<l;i++){
if(ch[i]>='a'&&ch[i]<='z'){
if(ch[i]=='a'||ch[i]=='b'||ch[i]=='c'||ch[i]=='d'){
if(ch[i]=='a'){
ch[i]='w';
}
else if(ch[i]=='b'){
ch[i]='x';
}
else if(ch[i]=='c'){
ch[i]='y';
}
else if(ch[i]=='d'){
ch[i]='z';
}
}
else {
ch[i]=ch[i]-4;
}
}
}
printf("%s\n",ch);
}
return 0;
}
|
main.c: In function 'main':
main.c:7:7: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
7 | while(gets(ch)){
| ^~~~
| fgets
|
s569442574
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
int main(void){
char x[100];
int i;
while(scanf("%[a-z .]", x)!=EOF){
getchar();
while(1){
if(strstr(x, " the ")!=NULL || trstr(x, " this ")!=NULL || trstr(x, " that ")!=NULL){
break;
}
for(i=0; i<strlen(x)-1; i++){
if(x[i]==' ')i++;
x[i]++;
if(x[i]>'z') x[i]='a';
}
}
printf("%s\n", x);
memset(x, '\0', 100);
}
return(0);
}
|
main.c: In function 'main':
main.c:15:38: error: implicit declaration of function 'trstr'; did you mean 'strstr'? [-Wimplicit-function-declaration]
15 | if(strstr(x, " the ")!=NULL || trstr(x, " this ")!=NULL || trstr(x, " that ")!=NULL){
| ^~~~~
| strstr
main.c:15:56: warning: comparison between pointer and integer
15 | if(strstr(x, " the ")!=NULL || trstr(x, " this ")!=NULL || trstr(x, " that ")!=NULL){
| ^~
main.c:15:84: warning: comparison between pointer and integer
15 | if(strstr(x, " the ")!=NULL || trstr(x, " this ")!=NULL || trstr(x, " that ")!=NULL){
| ^~
|
s240024771
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
int main(void){
char x[100];
int i;
while(gets(x)!=NULL){
while(1){
if(strstr(x, " the ")!=NULL || strstr(x, " this ")!=NULL || strstr(x, " that ")!=NULL){
break;
}
for(i=0; i<strlen(x)-1; i++){
if(x[i]==' ')i++;
x[i]++;
if(x[i]>'z') x[i]='a';
}
}
printf("%s\n", x);
memset(x, '\0', 100);
}
return(0);
}
|
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
11 | while(gets(x)!=NULL){
| ^~~~
| fgets
main.c:11:16: warning: comparison between pointer and integer
11 | while(gets(x)!=NULL){
| ^~
|
s337394277
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
int main(void){
char x[100];
int i;
while(gets(x)!=NULL){
while(1){
if(strstr(x, " the ")!=NULL || strstr(x, " this ")!=NULL || strstr(x, " that ")!=NULL){
break;
}
for(i=0; i<strlen(x); i++){
if(x[i]!=' ' && x[i]!='.'){
x[i]++;
}
if(x[i]>'z') x[i]='a';
}
}
printf("%s\n", x);
}
return(0);
}
|
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
11 | while(gets(x)!=NULL){
| ^~~~
| fgets
main.c:11:16: warning: comparison between pointer and integer
11 | while(gets(x)!=NULL){
| ^~
|
s919571725
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
int main(void){
char x[100];
int i;
while(gets(x)!=NULL){
while(1){
if(strstr(x, "the")==NULL && strstr(x, "this")==NULL && strstr(x, "that")==NULL){
for(i=0; i<strlen(x); i++){
if(x[i]!=' ' && x[i]!='.'){
x[i]++;
}
if(x[i]>'z') x[i]='a';
}
}
else{
break;
}
}
printf("%s\n", x);
}
return(0);
}
|
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
11 | while(gets(x)!=NULL){
| ^~~~
| fgets
main.c:11:16: warning: comparison between pointer and integer
11 | while(gets(x)!=NULL){
| ^~
|
s545180075
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
int main(void){
char x[100];
int i;
while(scanf("%s", x)!=EOF){
getchar(x);
while(1){
if(strstr(x, "the")==NULL && strstr(x, "this")==NULL && strstr(x, "that")==NULL){
for(i=0; i<strlen(x); i++){
if(x[i]!=' ' && x[i]!='.'){
x[i]++;
}
if(x[i]>'z') x[i]='a';
}
}
else{
break;
}
}
printf("%s\n", x);
}
return(0);
}
|
main.c: In function 'main':
main.c:12:5: error: too many arguments to function 'getchar'
12 | getchar(x);
| ^~~~~~~
In file included from main.c:1:
/usr/include/stdio.h:582:12: note: declared here
582 | extern int getchar (void);
| ^~~~~~~
|
s306424384
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
void Roll(char ch[], int times) {
int cnt = 0;
while (ch[cnt] != 0) {
if (96 < ch[cnt] && 123 > ch[cnt])
ch[cnt] = (ch[cnt] - 97 + times) % 26 + 97;
cnt++;
}
}
int main() {
char inp[100]; char buff[80];
int pos = 0, bpos = 0;
while (1) {
if (gets_s(inp, 100) == NULL)break;
while (1) {
if (96 < inp[pos] && 123 > inp[pos]) {
buff[bpos] = inp[pos];
bpos++; pos++;
}
else {
buff[bpos] = '\0';
if (strlen(buff) != 3 && strlen(buff) != 4) {
bpos = 0;
continue;
}
Roll(buff, 116 - inp[0]);
if (strcmp(buff, "this") == 0 || strcmp(buff, "that") == 0 || strcmp(buff, "the") == 0) {
Roll(inp, 116 - inp[0]);
break;
}
else {
bpos = 0;
continue;
}
}
}
puts(inp);
}
return 0;
}
|
main.c: In function 'main':
main.c:20:21: error: implicit declaration of function 'gets_s' [-Wimplicit-function-declaration]
20 | if (gets_s(inp, 100) == NULL)break;
| ^~~~~~
main.c:20:38: warning: comparison between pointer and integer
20 | if (gets_s(inp, 100) == NULL)break;
| ^~
|
s465480999
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
void Roll(char ch[], int times) {
int cnt = 0;
while (ch[cnt] != 0) {
if (96 < ch[cnt] && 123 > ch[cnt])
ch[cnt] = (ch[cnt] - 97 + times) % 26 + 97;
cnt++;
}
}
int main() {
char inp[100]; char buff[80];
int pos = 0, bpos = 0;
while (1) {
if (gets_s(inp, 100) == NULL)break;
while (1) {
if (96 < inp[pos] && 123 > inp[pos]) {
buff[bpos] = inp[pos];
bpos++; pos++;
}
else {
buff[bpos] = '\0';
if (strlen(buff) != 3 && strlen(buff) != 4) {
bpos = 0;
continue;
}
Roll(buff, 116 - inp[0]);
if (strcmp(buff, "this") == 0 || strcmp(buff, "that") == 0 || strcmp(buff, "the") == 0) {
Roll(inp, 116 - inp[0]);
break;
}
else {
bpos = 0;
continue;
}
}
}
puts(inp);
}
return 0;
}
|
main.c: In function 'main':
main.c:21:21: error: implicit declaration of function 'gets_s' [-Wimplicit-function-declaration]
21 | if (gets_s(inp, 100) == NULL)break;
| ^~~~~~
main.c:21:38: warning: comparison between pointer and integer
21 | if (gets_s(inp, 100) == NULL)break;
| ^~
|
s870430633
|
p00017
|
C
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
void Roll(char ch[], int times) {
int cnt = 0;
while (ch[cnt] != 0) {
if (96 < ch[cnt] && 123 > ch[cnt])
ch[cnt] = (ch[cnt] - 97 + times) % 26 + 97;
cnt++;
}
}
int main() {
char inp[100]; char buff[80];
int pos = 0, bpos = 0;
while (1) {
if (gets(inp) == NULL)break;
while (1) {
if (96 < inp[pos] && 123 > inp[pos]) {
buff[bpos] = inp[pos];
bpos++; pos++;
}
else {
buff[bpos] = '\0';
if (strlen(buff) != 3 && strlen(buff) != 4) {
bpos = 0;
continue;
}
Roll(buff, 116 - inp[0]);
if (strcmp(buff, "this") == 0 || strcmp(buff, "that") == 0 || strcmp(buff, "the") == 0) {
Roll(inp, 116 - inp[0]);
break;
}
else {
bpos = 0;
continue;
}
}
}
puts(inp);
}
return 0;
}
|
main.c: In function 'main':
main.c:21:21: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
21 | if (gets(inp) == NULL)break;
| ^~~~
| fgets
main.c:21:31: warning: comparison between pointer and integer
21 | if (gets(inp) == NULL)break;
| ^~
|
s554431438
|
p00017
|
C
|
#include "stdio.h"
#include "string.h"
int main(void)
{
char input[32]={0};
char strBuff[20][32]={0};
char length[20]={0};
int i,j,len,front,ret;
int strCnt=20;
int pt;
int pt2;
// Input
for(i = 0; i < 20; i++)
{
ret = scanf("%s", &strBuff[i]);
if(ret > 0)
{
length[i] = strlen(input);
}
else
{
strCnt = i-1;
}
}
// "th" serch
j = 0;
front = 0;
for(i = 0; i < strCnt; i++)
{
if((strBuff[0] - strBuff[1]) == 12)
{
pt = strBuff[0] - 20;
if(pt < 0)
{
pt = 26 + pt;
}
}
}
// Fixed String
do
{
for(i = 0; i < length[0]; i++)
{
strBuff[0][i] -= pt;
if(strBuff[0][i] < 97)
{
pt2 = 97 - strBuff[0][i];
strBuff[0][i] = 97 + (26 - pt2);
}
}
printf("%s", strBuff[0]);
j=1;
}
while(j < strCnt)
{
for(i = 1; i < length[j]; i++)
{
strBuff[j][i] -= pt;
if(strBuff[j][i] < 97)
{
pt2 = 97 - strBuff[j][i];
strBuff[j][i] = 97 + (26 - pt2);
}
}
printf(" %s", strBuff[j]);
j++;
}
printf("\n");
return 0;
}
|
main.c: In function 'main':
main.c:35:28: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
35 | pt = strBuff[0] - 20;
| ^
main.c:58:26: error: expected ';' before '{' token
58 | while(j < strCnt)
| ^
| ;
59 | {
| ~
|
s272613744
|
p00017
|
C
|
#include <stdio.h>
#include <string.h>
char Chipher(char c,int n){
return c+n <= 122 ? c+n : c+n-25;
}
int main(){
char a[85],b[85];
while(gets(a) != EOF){
int i,j,flag;
flag = 0;
for(i=0;i<26;i++){
for(j=0;j<strlen(a);j++){
if(a[j] == ' ' || a[j] == '.'){ b[j] = a[j];}
else {b[j] = Chipher(a[j],i);}
}
for(j=0;j<strlen(a)-3;j++){
if((a[j] == 't' && a[j+1] == 'h' && a[j+2] == 'e') ||
( a[j] == 't' && a[j+1] == 'h' && a[j+2] == 'i' && a[j+3] == 's') ||
( a[j] == 't' && a[j+1] == 'h' && a[j+2] == 'a' && a[j+3] == 't')
){flag = 1;}
}
j=strlen(a)-3;
if(a[j] == 't' && a[j+1] == 'h' && a[j+2] == 'e'){flag = 1;}
if(flag == 1)break;
}
b[strlen(a)] = '\0';
printf("%s\n",b);
}
return 0;
}
|
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
11 | while(gets(a) != EOF){
| ^~~~
| fgets
|
s416543912
|
p00017
|
C
|
#include <stdio.h>
#include <string.h>
char Chipher(char c,int n){
return c+n <= 122 ? c+n : c+n-25;
}
int main(){
char a[85],b[85];
while(gets(a) != EOF){
int i,j,flag;
flag = 0;
for(i=0;i<26;i++){
for(j=0;j <= strlen(a);j++){
if(a[j] == ' ' || a[j] == '.' || a[j] == '\0'){ b[j] = a[j];}
else {b[j] = Chipher(a[j],i);}
}
for(j=0;j<strlen(a)-3;j++){
if((b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'e') ||
( b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'i' && b[j+3] == 's') ||
( b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'a' && b[j+3] == 't')
){flag = 1;}
}
j=strlen(a)-3;
if(b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'e'){flag = 1;}
if(flag == 1){break;}
}
printf("%s\n",b);
}
return 0;
}
|
main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
13 | while(gets(a) != EOF){
| ^~~~
| fgets
|
s055595426
|
p00017
|
C
|
#include <stdio.h>
#include <string.h>
char Chipher(char c,int n){
return c-n >= 97 ? c-n : 123-(97-(c-n));
}
int main(){
char a[85],b[85];
while(gets(a) != EOF){
int i,j,flag;
flag = 0;
for(i=0;i<26;i++){
for(j=0;j <= strlen(a);j++){
if(a[j] == ' ' || a[j] == '.' || a[j] == '\0'){ b[j] = a[j];}
else {b[j] = Chipher(a[j],i);}
}
for(j=0;j<strlen(a)-3;j++){
if((b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'e') ||
( b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'i' && b[j+3] == 's') ||
( b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'a' && b[j+3] == 't')
){flag = 1;}
}
j=strlen(a)-3;
if(b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'e'){flag = 1;}
if(flag == 1){break;}
}
printf("%s\n",b);
}
return 0;
}
|
main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
13 | while(gets(a) != EOF){
| ^~~~
| fgets
|
s553136627
|
p00017
|
C
|
#include <stdio.h>
#include <string.h>
char Chipher(char c,int n){
return c-n >= 97 ? c-n : 123-(97-(c-n));
}
int main(){
char a[85],b[85];
while(gets(a) != EOF){
int i,j,flag;
flag = 0;
for(i=0;i<26;i++){
for(j=0;j <= strlen(a);j++){
if(a[j] == ' ' || a[j] == '.' || a[j] == '\0'){ b[j] = a[j];}
else {b[j] = Chipher(a[j],i);}
}
for(j=0;j<strlen(a)-3;j++){
if((b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'e') ||
( b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'i' && b[j+3] == 's') ||
( b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'a' && b[j+3] == 't')
){flag = 1;}
}
j=strlen(a)-3;
if(b[j] == 't' && b[j+1] == 'h' && b[j+2] == 'e'){flag = 1;}
if(flag == 1){break;}
}
printf("%s\n",b);
strcpy(a, "");
strcpy(b, "");
}
return 0;
}
|
main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
13 | while(gets(a) != EOF){
| ^~~~
| fgets
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.