submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s813364069
|
p00002
|
C++
|
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
int a;
int b;
int main() {
while (cin >> a >> b , != EOF) {
int i;
a = a + b;
while(a > 0) {
a = a / 10;
++i;
}
cout << i << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:9:26: error: expected primary-expression before '!=' token
9 | while (cin >> a >> b , != EOF) {
| ^~
|
s314111665
|
p00002
|
C++
|
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
int a;
int b;
int main() {
while (cin >> a >> b != EOF) {
int i;
a = a + b;
while(a > 0) {
a = a / 10;
++i;
}
cout << i << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:9:24: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
9 | while (cin >> a >> b != EOF) {
| ~~~~~~~~~~~~~ ^~
| |
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:9:24: note: candidate: 'operator!=(int, int)' (built-in)
9 | while (cin >> a >> b != EOF) {
| ^
a.cc:9:24: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1132:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1132 | operator!=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1132:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | while (cin >> a >> b != EOF) {
| ^~~
/usr/include/c++/14/bits/regex.h:1212:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1212 | operator!=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1212:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
9 | while (cin >> a >> b != EOF) {
| ^~~
/usr/include/c++/14/bits/regex.h:1305:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1305 | operator!=(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1305:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | while (cin >> a >> b != EOF) {
| ^~~
/usr/include/c++/14/bits/regex.h:1379:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1379 | operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1379:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
9 | while (cin >> a >> b != EOF) {
| ^~~
/usr/include/c++/14/bits/regex.h:1473:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1473 | operator!=(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1473:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | while (cin >> a >> b != EOF) {
| ^~~
/usr/include/c++/14/bits/regex.h:1547:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1547 | operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1547:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
9 | while (cin >> a >> b != EOF) {
| ^~~
/usr/include/c++/14/bits/regex.h:1647:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1647 | operator!=(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1647:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | while (cin >> a >> b != EOF) {
| ^~~
/usr/include/c++/14/bits/regex.h:2213:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator!=(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2213 | operator!=(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2213:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
9 | while (cin >> a >> b != EOF) {
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
9 | while (cin >> a >> b != EOF) {
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
455 | operator!=(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | while (cin >> a >> b != EOF) {
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
500 | operator!=(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | while (cin >> a >> b != EOF) {
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1686 | operator!=(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | while (cin >> a >> b != EOF) {
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1753 | operator!=(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | while (cin >> a >> b != EOF) {
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42:
/usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed:
a.cc:9:27: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>'
9 | while (cin >> a >> b != EOF) {
| ^~~
In file included from /usr/include/c++/14/stri
|
s733974486
|
p00002
|
C++
|
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
int a;
int b;
int main() {
while (c != EOF) {
c = dainyuu()
int i;
a = a + b;
while(a > 0) {
a = a / 10;
++i;
}
cout << i << endl;
}
}
int dainyuu() {
cin >> a >> b;
}
|
a.cc: In function 'int main()':
a.cc:9:10: error: 'c' was not declared in this scope
9 | while (c != EOF) {
| ^
a.cc:10:9: error: 'dainyuu' was not declared in this scope
10 | c = dainyuu()
| ^~~~~~~
a.cc:15:9: error: 'i' was not declared in this scope
15 | ++i;
| ^
a.cc:18:13: error: 'i' was not declared in this scope
18 | cout << i << endl;
| ^
a.cc: In function 'int dainyuu()':
a.cc:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
25 | }
| ^
|
s924078590
|
p00002
|
C++
|
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
int a;
int b;
int main() {
while (c != EOF) {
c = dainyuu();
int i;
a = a + b;
while(a > 0) {
a = a / 10;
++i;
}
cout << i << endl;
}
}
int dainyuu() {
cin >> a >> b;
}
|
a.cc: In function 'int main()':
a.cc:9:10: error: 'c' was not declared in this scope
9 | while (c != EOF) {
| ^
a.cc:10:9: error: 'dainyuu' was not declared in this scope
10 | c = dainyuu();
| ^~~~~~~
a.cc: In function 'int dainyuu()':
a.cc:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
25 | }
| ^
|
s052274968
|
p00002
|
C++
|
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
int a;
int b;
c = dainyuu()
int main() {
while (c != EOF) {
dainyuu();
int i;
a = a + b;
while(a > 0) {
a = a / 10;
++i;
}
cout << i << endl;
}
}
int dainyuu() {
cin >> a >> b;
}
|
a.cc:7:1: error: 'c' does not name a type
7 | c = dainyuu()
| ^
a.cc: In function 'int dainyuu()':
a.cc:26:1: warning: no return statement in function returning non-void [-Wreturn-type]
26 | }
| ^
|
s762924887
|
p00002
|
C++
|
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
int a,b,c;
c = dainyuu()
int main() {
while (c != EOF) {
dainyuu();
int i;
a = a + b;
while(a > 0) {
a = a / 10;
++i;
}
cout << i << endl;
}
}
int dainyuu() {
cin >> a >> b;
}
|
a.cc:6:1: error: 'c' does not name a type
6 | c = dainyuu()
| ^
a.cc: In function 'int dainyuu()':
a.cc:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
25 | }
| ^
|
s832578927
|
p00002
|
C++
|
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
int a,b,c;
c = dainyuu();
int main() {
while (c != EOF) {
int i;
a = a + b;
while(a > 0) {
a = a / 10;
++i;
}
cout << i << endl;
}
}
int dainyuu() {
cin >> a >> b;
}
|
a.cc:6:1: error: 'c' does not name a type
6 | c = dainyuu();
| ^
a.cc: In function 'int dainyuu()':
a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
24 | }
| ^
|
s369362631
|
p00002
|
C++
|
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
int a,b;
int main() {
while (dainyuu() != EOF) {
int i;
a = a + b;
while(a > 0) {
a = a / 10;
++i;
}
cout << i << endl;
}
}
void dainyuu() {
cin >> a >> b;
}
|
a.cc: In function 'int main()':
a.cc:8:10: error: 'dainyuu' was not declared in this scope
8 | while (dainyuu() != EOF) {
| ^~~~~~~
|
s861792764
|
p00002
|
C++
|
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
int a,b;
int main() {
while (dainyuu() != EOF) {
int i;
a = a + b;
while(a > 0) {
a = a / 10;
++i;
}
cout << i << endl;
}
}
int dainyuu() {
cin >> a >> b;
}
|
a.cc: In function 'int main()':
a.cc:8:10: error: 'dainyuu' was not declared in this scope
8 | while (dainyuu() != EOF) {
| ^~~~~~~
a.cc: In function 'int dainyuu()':
a.cc:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
23 | }
| ^
|
s871977121
|
p00002
|
C++
|
#include <cstdio>
??????
#define MAX 1000000
#define MIN 0
#define SIZE 200
??????
int main() {
??int i,j;
??int a,b;
??int cnt = 0;
??int buf = 0;
??int sets[SIZE];
??????
??while(scanf("%d %d",&a,&b) != EOF) {
????if((a < MIN) || (b > MAX)) {
??????continue;
????}
????????
????sets[cnt] = a + b;
????++cnt;
??}
????
??for(i = 0;i <= cnt;++i) {
????j = MAX;
??
????while(j != 0) {
??????if((sets[i] / j) != 0) {
????????++buf;
????????sets[i] -= (sets[i] / j) * j;
??????}
??????
??????j /= 10;
????}
????
sets[i] = buf;
????buf = 0;
??}
????
??for(i = 0;i <= cnt;++i) {
????printf("%d\n",sets[i]);
??}
????
??return 0;
}
|
a.cc:2:1: error: expected unqualified-id before '?' token
2 | ??????
| ^
|
s437770410
|
p00002
|
C++
|
#include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
using namespace std;
/*temp*/
int main(){
int i, j;
while(cin >> i >> j){
int n = 0;
i += j;
while(i > 0){
i /= 10;
++n;
}
}
cout << n << '\n';
}
|
a.cc: In function 'int main()':
a.cc:19:13: error: 'n' was not declared in this scope
19 | cout << n << '\n';
| ^
|
s166931348
|
p00002
|
C++
|
#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
int a = 0, b = 0;
int v;
int i = 0;
while (scanf_s("%d %d",&a,&b)!= EOF){
int c = a + b;
if (a + b < 10){
cout << "1" << endl;
}
else if (a + b < 100){
cout << "2" << endl;
}
else if (a + b < 1000){
cout << "3" << endl;
}
else if (a + b < 10000){
cout << "4" << endl;
}
else if (a + b < 100000){
cout << "5" << endl;
}
else if (a + b < 1000000){
cout << "6" << endl;
}
else{
cout << "7" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
8 | while (scanf_s("%d %d",&a,&b)!= EOF){
| ^~~~~~~
| scanf
|
s334543027
|
p00002
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int a, b;
while (cin>>a>>b)
{
char s[7];
sprintf_s(s, "%d", a + b);
cout << strlen(s) << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:17: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
10 | sprintf_s(s, "%d", a + b);
| ^~~~~~~~~
| sprintf
a.cc:11:25: error: 'strlen' was not declared in this scope
11 | cout << strlen(s) << endl;
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 |
|
s894104660
|
p00002
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int a, b;
while (cin>>a>>b)
{
char s[7];
sprintf(s, "%d", a + b);
cout << strlen(s) << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:25: error: 'strlen' was not declared in this scope
11 | cout << strlen(s) << endl;
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 |
|
s012547420
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int c = 0;
void keta(int C) {
if (C > 9) {
c++;
keta(C/10);
}
return;
}
int main()
{
while (1) {
if (cin.eof)
break;
c = 0;
int A, B,C;
cin >> A>> B;
C = A + B;
keta(C);
c++;
cout << c<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:28: error: cannot convert 'std::basic_ios<char>::eof' from type 'bool (std::basic_ios<char>::)() const' to type 'bool'
17 | if (cin.eof)
| ^
|
s554668240
|
p00002
|
C++
|
#include<iostream>
#include<string.h>
using namespace std;
int main(){
int a,b,c;
char ans[10];
cin>>a>>b;
ans=(char)a+b;
c=strlen(ans);
cout<<c<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:4: error: incompatible types in assignment of 'int' to 'char [10]'
8 | ans=(char)a+b;
| ~~~^~~~~~~~~~
|
s539195484
|
p00002
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int a, b;
while(cin >> a >> b){
a = log10(a + b) + 1;
cout << a << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:21: error: 'log10' was not declared in this scope
9 | a = log10(a + b) + 1;
| ^~~~~
|
s218627255
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main() {
int x, y, count;
cin >> x >> y;
char ch[] = (char)(x + y);
for(int i = 0; ch[i] == '\0'; ++i) {
++count;
}
cout << count << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:15: error: initializer fails to determine size of 'ch'
8 | char ch[] = (char)(x + y);
| ^~~~~~~~~~~~~
a.cc:8:15: error: array must be initialized with a brace-enclosed initializer
|
s554534580
|
p00002
|
C++
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
int a, b, c, d;
char s[10000];
scanf("%d %d", &a, &b);
c = a + b;
itoa(c ,s , 10);
d = strlen(s);
printf("%d", d);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:5: error: 'itoa' was not declared in this scope
10 | itoa(c ,s , 10);
| ^~~~
|
s156686775
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a,b,sum=0;
cin>>a>>b;
sum=a+b;
if(sum<10)cout<<"1"<<endl;
else if(sum<100)cout<<"2"<<endl;
else if(sum<1000)cout<<"3"<<endl;
else if(sum<10000)cout<<"4"<<endl;
else if(sum<100000)cout<<"5"<<endl;
else if(sum<1000000)cout<<"6"<<endl;
else if(sum<10000000)cout<<"7"<<endl;
else if(sum<100000000)out<<"8"<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:23: error: 'out' was not declared in this scope
14 | else if(sum<100000000)out<<"8"<<endl;
| ^~~
|
s858021054
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a,b,sum=0,count;
while(cin>>a>>b){
count++:
sum=a+b;
if(sum<10)cout<<"1"<<endl;
else if(sum<100)cout<<"2"<<endl;
else if(sum<1000)cout<<"3"<<endl;
else if(sum<10000)cout<<"4"<<endl;
else if(sum<100000)cout<<"5"<<endl;
else if(sum<1000000)cout<<"6"<<endl;
else if(sum<10000000)cout<<"7"<<endl;
else if(sum<100000000)cout<<"8"<<endl;
if(count==200)break;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:16: error: expected ';' before ':' token
6 | count++:
| ^
| ;
|
s181400719
|
p00002
|
C++
|
#include <iostream>
#include <cmath>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int a,b,c,ans;
while(cin >> a >> b;){
c = a + b;
ans = (int)log10((double)c) + 1;
cout << ans << "\n";
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:28: error: expected ')' before ';' token
11 | while(cin >> a >> b;){
| ~ ^
| )
a.cc:11:29: error: expected primary-expression before ')' token
11 | while(cin >> a >> b;){
| ^
|
s453938941
|
p00002
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int a,b;
int c[200][2]
for(int i=0;i<200,i++)
{
c[i][0]=a;
c[i][1]=b;
cin>>a>>b;
}
for(int j=0;j<200,j++)
{
if(c[j][1]+c[j][1]<10)
{
cout<<1<<endl;
}
else if(c[j][0]+c[j][1]<100)
{
cout<<2<<endl;
}
else if(c[j][0]+c[j][1]<1000)
{
cout<<3<<endl;
}
else if(c[j][0]+c[j][1]<10000)
{
cout<<4<<endl;
}
else if(c[j][0]+c[j][1]<100000)
{
cout<<5<<endl;
}
else if(c[j][0]+c[j][1]<1000000)
{
cout<<6<<endl;
}
else
{
cout<<7<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:1: error: expected initializer before 'for'
7 | for(int i=0;i<200,i++)
| ^~~
a.cc:7:13: error: 'i' was not declared in this scope
7 | for(int i=0;i<200,i++)
| ^
a.cc:13:22: error: expected ';' before ')' token
13 | for(int j=0;j<200,j++)
| ^
| ;
a.cc:15:4: error: 'c' was not declared in this scope
15 | if(c[j][1]+c[j][1]<10)
| ^
|
s803275530
|
p00002
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int a,b,i;
i=0;
while(cin>>a>>b;)
{
cin>>a>>b;
if(a+b<10)
{
cout<<1<<endl;
}
else if(a+b<100)
{
cout<<2<<endl;
}
else if(a+b<1000)
{
cout<<3<<endl;
}
else if(a+b<10000)
{
cout<<4<<endl;
}
else if(a+b<100000)
{
cout<<5<<endl;
}
else if(a+b<1000000)
{
cout<<6<<endl;
}
else if(a+b<10000000)
{
cout<<7<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:16: error: expected ')' before ';' token
7 | while(cin>>a>>b;)
| ~ ^
| )
a.cc:7:17: error: expected primary-expression before ')' token
7 | while(cin>>a>>b;)
| ^
|
s656639889
|
p00002
|
C++
|
int main()
{
int a, b,sum,n;
n = 0;
while (cin >> a >> b)
{
sum = a + b;
for (;;)
{
sum = sum / 10;
n = n + 1;
if (sum == 0)
{
break;
}
}
cout << n << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:16: error: 'cin' was not declared in this scope
7 | while (cin >> a >> b)
| ^~~
a.cc:22:17: error: 'cout' was not declared in this scope
22 | cout << n << endl;
| ^~~~
a.cc:22:30: error: 'endl' was not declared in this scope
22 | cout << n << endl;
| ^~~~
|
s462197292
|
p00002
|
C++
|
#include<stdio.h>
int main(void)
{
int a,b,i,n;
scanf("%d %d",&a,&b);
a=a+b;
for(i=1;i<8;i++){
if(a<10){
break;
}
a=a/10
}
printf("%d\n",i);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:23: error: expected ';' before '}' token
11 | a=a/10
| ^
| ;
12 | }
| ~
|
s566581806
|
p00002
|
C++
|
#include <vector>
#ifndef EOF
#define EOF (-1)
#endif
int main() {
std::vector<int> digits;
int a, b;
while (scanf("%d %d", &a, &b) != EOF)
{
int sum = a + b;
int t = sum / 10;
int digit = 0;
while (t > 0) {
digit ++;
t = t / 10;
}
digits.push_back(digit);
}
for (int i = 0; i < digits.size(); i++) {
std::cout << digits[i] << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:12: error: 'scanf' was not declared in this scope
10 | while (scanf("%d %d", &a, &b) != EOF)
| ^~~~~
a.cc:23:14: error: 'cout' is not a member of 'std'
23 | std::cout << digits[i] << std::endl;
| ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <vector>
+++ |+#include <iostream>
2 |
a.cc:23:40: error: 'endl' is not a member of 'std'
23 | std::cout << digits[i] << std::endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include <vector>
+++ |+#include <ostream>
2 |
|
s982042241
|
p00002
|
C++
|
k
|
a.cc:1:1: error: 'k' does not name a type
1 | k
| ^
|
s395049522
|
p00002
|
C++
|
#include<iostream>
#include<vector>
#include<map>
#include<string>
using namespace std;
int get_digit(int num);
int main() {
int first;
int second;
int data_cnt = 0;
std::vector<int> inputs;
while ((cin >> first >> second) || (data_cnt < 200)) {
data_cnt++;
inputs.push_back(first + second);
}
for (int i = 0; i < data_cnt; i++) {
cout << get_digit(inputs[i]) << endl;
}
return 0;
}
int get_digit(int num) {
return std::to_string(num).length();
}
template < typename T > std::string to_string(const T& n)
{
std::ostringstream stm;
stm << n;
return stm.str();
}
|
a.cc: In function 'std::string to_string(const T&)':
a.cc:33:28: error: 'stm' has incomplete type
33 | std::ostringstream stm;
| ^~~
In file included from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/iosfwd:106:11: note: declaration of 'std::ostringstream' {aka 'class std::__cxx11::basic_ostringstream<char>'}
106 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
|
s027261794
|
p00002
|
C++
|
#include<iostream>
#include<vector>
#include<map>
#include<string>
using namespace std;
int get_digit(int num);
template < typename T > std::string to_string(const T& n)
{
std::ostringstream stm;
stm << n;
return stm.str();
}
int main() {
int first;
int second;
int data_cnt = 0;
std::vector<int> inputs;
while ((cin >> first >> second) || (data_cnt < 200)) {
data_cnt++;
inputs.push_back(first + second);
}
for (int i = 0; i < data_cnt; i++) {
cout << get_digit(inputs[i]) << endl;
}
return 0;
}
int get_digit(int num) {
return std::to_string(num).length();
}
|
a.cc: In function 'std::string to_string(const T&)':
a.cc:11:28: error: 'stm' has incomplete type
11 | std::ostringstream stm;
| ^~~
In file included from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/iosfwd:106:11: note: declaration of 'std::ostringstream' {aka 'class std::__cxx11::basic_ostringstream<char>'}
106 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
|
s885543029
|
p00002
|
C++
|
#include<iostream>
#include<vector>
#include<map>
#include<string>
using namespace std;
int get_digit(int num);
int main() {
int first;
int second;
int data_cnt = 0;
std::vector<int> inputs;
while ((cin >> first >> second) || (data_cnt < 200)) {
data_cnt++;
inputs.push_back(first + second);
}
for (int i = 0; i < data_cnt; i++) {
cout << get_digit(inputs[i]) << endl;
}
return 0;
}
int get_digit(int num) {
return log10(num) + 1;
}
|
a.cc: In function 'int get_digit(int)':
a.cc:28:16: error: 'log10' was not declared in this scope
28 | return log10(num) + 1;
| ^~~~~
|
s478480406
|
p00002
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int x,y;
for(;;){
cin >> x >> y;
if(cin.eof()) break;
cout << to_string(a+b).length() << "\n";
}
}
|
a.cc: In function 'int main()':
a.cc:11:27: error: 'a' was not declared in this scope
11 | cout << to_string(a+b).length() << "\n";
| ^
a.cc:11:29: error: 'b' was not declared in this scope
11 | cout << to_string(a+b).length() << "\n";
| ^
|
s169811057
|
p00002
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int x,y;
for(;;){
cin >> x >> y;
if(cin.eof()) break;
cout << to_string(x+y).length() << "\n";
}
}
template < typename T > std::string to_string( const T& n ){
std::ostringstream stm ;
stm << n ;
return stm.str() ;
}
|
a.cc: In function 'std::string to_string(const T&)':
a.cc:15:24: error: 'stm' has incomplete type
15 | std::ostringstream stm ;
| ^~~
In file included from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/iosfwd:106:11: note: declaration of 'std::ostringstream' {aka 'class std::__cxx11::basic_ostringstream<char>'}
106 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
|
s905148646
|
p00002
|
C++
|
fn main(){
loop{
let mut buf = String::new();
let _ = io::stdin().read_line(&mut buf);
if buf == "" { break; }
let v: Vec<_> = buf.split_whitespace().collect();
let a: i32 = v[0].parse().unwrap();
let b: i32 = v[1].parse().unwrap();
println!("{}", (a + b).to_string().len());
}
}
// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
pub trait FromLn {
fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
let mut buf = String::new();
let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
let mut vs = vec![];
for _ in 0..n {
vs.push(readln());
}
vs
}
macro_rules! fromln_primitives {
($($t:ty),*) => { $(
impl FromLn for $t {
fn fromln(s: &str) -> $t {
s.parse().unwrap()
}
}
)* }
}
fromln_primitives!(
String,
bool,
f32,
f64,
isize,
i8,
i16,
i32,
i64,
usize,
u8,
u16,
u32,
u64
);
impl<T> FromLn for Vec<T>
where
T: FromLn,
{
fn fromln(s: &str) -> Vec<T> {
s.split_whitespace().map(T::fromln).collect()
}
}
impl FromLn for Vec<char> {
fn fromln(s: &str) -> Vec<char> {
s.chars().collect()
}
}
macro_rules! fromln_tuple {
($($t:ident),*) => {
impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
fn fromln(s: &str) -> ($($t),*) {
let mut it = s.split_whitespace();
let t = ($($t::fromln(it.next().unwrap())),*);
assert_eq!(it.next(), None);
t
}
}
}
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);
|
a.cc:17:2: error: invalid preprocessing directive #[
17 | #[allow(unused_imports)]
| ^
a.cc:19:2: error: invalid preprocessing directive #[
19 | #[allow(unused_imports)]
| ^
a.cc:31:14: error: too many decimal points in number
31 | for _ in 0..n {
| ^~~~
a.cc:1:1: error: 'fn' does not name a type
1 | fn main(){
| ^~
a.cc:18:1: error: 'use' does not name a type
18 | use std::cmp::{max, min};
| ^~~
a.cc:21:1: error: 'pub' does not name a type
21 | pub trait FromLn {
| ^~~
a.cc:24:1: error: 'pub' does not name a type
24 | pub fn readln<T: FromLn>() -> T {
| ^~~
a.cc:29:1: error: 'pub' does not name a type
29 | pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
| ^~~
a.cc:36:1: error: 'macro_rules' does not name a type
36 | macro_rules! fromln_primitives {
| ^~~~~~~~~~~
a.cc:45:1: error: 'fromln_primitives' does not name a type
45 | fromln_primitives!(
| ^~~~~~~~~~~~~~~~~
a.cc:61:1: error: 'impl' does not name a type
61 | impl<T> FromLn for Vec<T>
| ^~~~
a.cc:69:1: error: 'impl' does not name a type
69 | impl FromLn for Vec<char> {
| ^~~~
a.cc:74:1: error: 'macro_rules' does not name a type
74 | macro_rules! fromln_tuple {
| ^~~~~~~~~~~
a.cc:86:1: error: 'fromln_tuple' does not name a type
86 | fromln_tuple!(A, B);
| ^~~~~~~~~~~~
a.cc:87:1: error: 'fromln_tuple' does not name a type
87 | fromln_tuple!(A, B, C);
| ^~~~~~~~~~~~
a.cc:88:1: error: 'fromln_tuple' does not name a type
88 | fromln_tuple!(A, B, C, D);
| ^~~~~~~~~~~~
a.cc:89:1: error: 'fromln_tuple' does not name a type
89 | fromln_tuple!(A, B, C, D, E);
| ^~~~~~~~~~~~
a.cc:90:1: error: 'fromln_tuple' does not name a type
90 | fromln_tuple!(A, B, C, D, E, F);
| ^~~~~~~~~~~~
|
s702046038
|
p00002
|
C++
|
fn main() {
let n = readln();
let mut c:f32 = 100000.0;
for _i in 0..n {
c=c+c*0.05;
if c%1000.0!=0.0{
c=(((c/1000.0) as i32) as f32)*1000.0+1000.0;
}
}
println!("{:.0}",c);
}
// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, VecDeque};
pub trait FromLn {
fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
let mut buf = String::new();
let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
let mut vs = vec![];
for _ in 0..n {
vs.push(readln());
}
vs
}
macro_rules! fromln_primitives {
($($t:ty),*) => { $(
impl FromLn for $t {
fn fromln(s: &str) -> $t {
s.parse().unwrap()
}
}
)* }
}
fromln_primitives!(
String,
bool,
f32,
f64,
isize,
i8,
i16,
i32,
i64,
usize,
u8,
u16,
u32,
u64
);
impl<T> FromLn for Vec<T>
where
T: FromLn,
{
fn fromln(s: &str) -> Vec<T> {
s.split_whitespace().map(T::fromln).collect()
}
}
impl FromLn for Vec<char> {
fn fromln(s: &str) -> Vec<char> {
s.chars().collect()
}
}
macro_rules! fromln_tuple {
($($t:ident),*) => {
impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
fn fromln(s: &str) -> ($($t),*) {
let mut it = s.split_whitespace();
let t = ($($t::fromln(it.next().unwrap())),*);
assert_eq!(it.next(), None);
t
}
}
}
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);
|
a.cc:6:19: error: too many decimal points in number
6 | for _i in 0..n {
| ^~~~
a.cc:16:6: error: invalid preprocessing directive #[
16 | #[allow(unused_imports)]
| ^
a.cc:18:6: error: invalid preprocessing directive #[
18 | #[allow(unused_imports)]
| ^
a.cc:31:18: error: too many decimal points in number
31 | for _ in 0..n {
| ^~~~
a.cc:2:1: error: 'fn' does not name a type
2 | fn main() {
| ^~
a.cc:17:5: error: 'use' does not name a type
17 | use std::cmp::{max, min};
| ^~~
a.cc:19:5: error: 'use' does not name a type
19 | use std::collections::{HashMap, HashSet, VecDeque};
| ^~~
a.cc:21:5: error: 'pub' does not name a type
21 | pub trait FromLn {
| ^~~
a.cc:24:5: error: 'pub' does not name a type
24 | pub fn readln<T: FromLn>() -> T {
| ^~~
a.cc:29:5: error: 'pub' does not name a type
29 | pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
| ^~~
a.cc:36:5: error: 'macro_rules' does not name a type
36 | macro_rules! fromln_primitives {
| ^~~~~~~~~~~
a.cc:45:5: error: 'fromln_primitives' does not name a type
45 | fromln_primitives!(
| ^~~~~~~~~~~~~~~~~
a.cc:61:5: error: 'impl' does not name a type
61 | impl<T> FromLn for Vec<T>
| ^~~~
a.cc:69:5: error: 'impl' does not name a type
69 | impl FromLn for Vec<char> {
| ^~~~
a.cc:74:5: error: 'macro_rules' does not name a type
74 | macro_rules! fromln_tuple {
| ^~~~~~~~~~~
a.cc:86:1: error: 'fromln_tuple' does not name a type
86 | fromln_tuple!(A, B);
| ^~~~~~~~~~~~
a.cc:87:1: error: 'fromln_tuple' does not name a type
87 | fromln_tuple!(A, B, C);
| ^~~~~~~~~~~~
a.cc:88:1: error: 'fromln_tuple' does not name a type
88 | fromln_tuple!(A, B, C, D);
| ^~~~~~~~~~~~
a.cc:89:1: error: 'fromln_tuple' does not name a type
89 | fromln_tuple!(A, B, C, D, E);
| ^~~~~~~~~~~~
a.cc:90:1: error: 'fromln_tuple' does not name a type
90 | fromln_tuple!(A, B, C, D, E, F);
| ^~~~~~~~~~~~
|
s117552326
|
p00002
|
C++
|
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
|
s182368798
|
p00002
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int a, b, i = 10;
while (cin >> a >> b) {
for (int j = 1;; j++) {
if (a + b < pow(10, j)) {
cout << j << endl;
break;
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:37: error: 'pow' was not declared in this scope
9 | if (a + b < pow(10, j)) {
| ^~~
|
s363801847
|
p00002
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int a, b, i = 10;
while (cin >> a >> b) {
for (int j = 1;; j++) {
if (a + b < pow(10, j)) {
cout << j << endl;
break;
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:37: error: 'pow' was not declared in this scope
9 | if (a + b < pow(10, j)) {
| ^~~
|
s756166850
|
p00002
|
C++
|
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
void readData(vector<string>& input_data){
}
int perseString(string line) {
stringstream ss;
ss << line;
int a, b;
ss >> a >> b;
return a + b;
}
int countDigit(int n){
int cnt = 1;
while(n /= 10)
++cnt;
return cnt;
}
void mainRoutine(){
vector<string> input_data;
readData(input_data);
for(int i = 0; i < input_data.size(); ++i){
auto ret = perseString("100 200");
cout << countDigit(ret) << endl;
}
}
int main() {
mainRoutine();
return 0;
}
|
a.cc:7:6: error: variable or field 'readData' declared void
7 | void readData(vector<string>& input_data){
| ^~~~~~~~
a.cc:7:15: error: 'vector' was not declared in this scope
7 | void readData(vector<string>& input_data){
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <sstream>
+++ |+#include <vector>
3 | #include <string>
a.cc:7:28: error: expected primary-expression before '>' token
7 | void readData(vector<string>& input_data){
| ^
a.cc:7:31: error: 'input_data' was not declared in this scope
7 | void readData(vector<string>& input_data){
| ^~~~~~~~~~
a.cc: In function 'void mainRoutine()':
a.cc:30:5: error: 'vector' was not declared in this scope
30 | vector<string> input_data;
| ^~~~~~
a.cc:30:5: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:30:18: error: expected primary-expression before '>' token
30 | vector<string> input_data;
| ^
a.cc:30:20: error: 'input_data' was not declared in this scope
30 | vector<string> input_data;
| ^~~~~~~~~~
a.cc:32:5: error: 'readData' was not declared in this scope
32 | readData(input_data);
| ^~~~~~~~
|
s771189150
|
p00002
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int> sum;
vector<string> truss;
int a,b;
while(cin >> a >> b){
int num = a + b;
int count = 0;
while(num){
count++;
num /= 10;
}
cout << count << endl;
}
/*
sum.push_back(a+b);
}
for(int i=0;i<(int)sum.size();i++) {
truss.push_back(to_string(sum[i]));
cout<<truss[i].size()<<endl;
*/
}
return 0;
}
|
a.cc:26:3: error: expected unqualified-id before 'return'
26 | return 0;
| ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
27 | }
| ^
|
s379686093
|
p00002
|
C++
|
#include<stdio.h>
#include<math.h>
int main() {
double a, b;
while (scanf("%d %d", &a, &b)){
printf("%d\n",(int)log10(double)(a+b) + 1);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:42: error: expected primary-expression before 'double'
7 | printf("%d\n",(int)log10(double)(a+b) + 1);
| ^~~~~~
|
s062259604
|
p00002
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a, b;
int sum, digit;
while(cin >> a >> b){
sum = a + b;
digit = 0;
while(sum){
sum = sum \ 10;
digit++;
};
cout << digit << endl;
};
return 0;
}
|
a.cc:12:23: error: stray '\' in program
12 | sum = sum \ 10;
| ^
a.cc: In function 'int main()':
a.cc:12:22: error: expected ';' before numeric constant
12 | sum = sum \ 10;
| ^ ~~
| ;
|
s538516719
|
p00002
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a, b, sum, digit;
while(cin >> a >> b){
sum = a + b;
digit = 0;
while(digit){
sum = sum \ 10;
digit++;
}
if(digit == 0){ digit = 1; }
cout << digit << endl;
};
return 0;
}
|
a.cc:10:23: error: stray '\' in program
10 | sum = sum \ 10;
| ^
a.cc: In function 'int main()':
a.cc:10:22: error: expected ';' before numeric constant
10 | sum = sum \ 10;
| ^ ~~
| ;
|
s979278955
|
p00002
|
C++
|
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
|
s423694736
|
p00002
|
C++
|
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
|
s084761147
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int getDigitNumber(int n){
return n > 0 ? 1 + getDigitNumber(n / 10) : 0;
}
int main(int argc, char const *argv[]) {
while(){
int a,b;
cin >> a >> b;
cout << getDigitNumber(a+b) << endl;
}
return 0;
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:10:9: error: expected primary-expression before ')' token
10 | while(){
| ^
|
s272197037
|
p00002
|
C++
|
A = []
B = []
s = True
while(s):
try:
a,b = map(int, input().split())
except ValueError:
break
A.append(a)
B.append(b)
for i in range(len(A)):
sum = A[i] + B[i]
digits = 1
while(sum//10 != 0):
digits += 1
sum //= 10
print(str(digits))
|
a.cc:2:1: error: 'A' does not name a type
2 | A = []
| ^
|
s231551134
|
p00002
|
C++
|
#include<iostream>
#include<cstdio>
#include<string>
int main(){
string a, b;
while((cin >> a >> b) != EOF){
printf("%d %d\n", a.length(), b.length());
}
}
|
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
5 | string a, b;
| ^~~~~~
a.cc:5:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:6:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | while((cin >> a >> b) != EOF){
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:19: error: 'a' was not declared in this scope
6 | while((cin >> a >> b) != EOF){
| ^
a.cc:6:24: error: 'b' was not declared in this scope
6 | while((cin >> a >> b) != EOF){
| ^
|
s953435854
|
p00002
|
C++
|
#include<iostream>
#include<cstdio>
#include<string>
int main(){
string a, b;
while(cin >> a >> b){
printf("%d %d\n", a.length(), b.length());
}
}
|
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
5 | string a, b;
| ^~~~~~
a.cc:5:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:6:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | while(cin >> a >> b){
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:18: error: 'a' was not declared in this scope
6 | while(cin >> a >> b){
| ^
a.cc:6:23: error: 'b' was not declared in this scope
6 | while(cin >> a >> b){
| ^
|
s302375877
|
p00002
|
C++
|
#include<iostream>
#include<cstdio>
#include<string>
int main(){
string a, b;
while(cin >> a){
cin >> b;
printf("%d %d\n", a.length(), b.length());
}
}
|
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
5 | string a, b;
| ^~~~~~
a.cc:5:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:6:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | while(cin >> a){
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:18: error: 'a' was not declared in this scope
6 | while(cin >> a){
| ^
a.cc:7:16: error: 'b' was not declared in this scope
7 | cin >> b;
| ^
|
s679093028
|
p00002
|
C++
|
#include<iostream>
#include<cstdio>
#include<string>
int main(){
string a, b;
while(cin >> a){
cin >> b;
printf("%d %d\n", a.length(), b.length());
}
}
|
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
5 | string a, b;
| ^~~~~~
a.cc:5:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:6:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | while(cin >> a){
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:18: error: 'a' was not declared in this scope
6 | while(cin >> a){
| ^
a.cc:7:16: error: 'b' was not declared in this scope
7 | cin >> b;
| ^
|
s541098712
|
p00002
|
C++
|
#include<iostream>
#include<cstdio>
#include<string>
int main(){
int a, b;
while(cin >> a){
cin >> b;
string s = to_string(a+b);
printf("%d\n", s.length());
}
}
|
a.cc: In function 'int main()':
a.cc:6:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | while(cin >> a){
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:9: error: 'string' was not declared in this scope
8 | string s = to_string(a+b);
| ^~~~~~
a.cc:8:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:9:24: error: 's' was not declared in this scope
9 | printf("%d\n", s.length());
| ^
|
s060368018
|
p00002
|
C++
|
#include<iostream>
#include<cstdio>
#include<string>
int main(){
int a, b;
while(cin >> a >> b){
//cin >> b;
string s = to_string(a+b);
printf("%d\n", s.length());
}
}
|
a.cc: In function 'int main()':
a.cc:6:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | while(cin >> a >> b){
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:9: error: 'string' was not declared in this scope
8 | string s = to_string(a+b);
| ^~~~~~
a.cc:8:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:9:24: error: 's' was not declared in this scope
9 | printf("%d\n", s.length());
| ^
|
s865283694
|
p00002
|
C++
|
#include<iostream>
#include<cstdio>
#include<string>
int main(){
int a, b;
while(~scanf("%d%d", &a, &b)){
string s = to_string(a+b);
printf("%d\n", s.length());
}
}
|
a.cc: In function 'int main()':
a.cc:7:9: error: 'string' was not declared in this scope
7 | string s = to_string(a+b);
| ^~~~~~
a.cc:7:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:8:24: error: 's' was not declared in this scope
8 | printf("%d\n", s.length());
| ^
|
s195801040
|
p00002
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main(){
long long a,b;
while(cin >> a >> b;){
long long sum = a + b;
string str = to_string(sum);
cout << str.length()<<endl;}
}
|
a.cc: In function 'int main()':
a.cc:7:24: error: expected ')' before ';' token
7 | while(cin >> a >> b;){
| ~ ^
| )
a.cc:7:25: error: expected primary-expression before ')' token
7 | while(cin >> a >> b;){
| ^
|
s751147640
|
p00002
|
C++
|
#include<cstdio>
int main(){
int n,n1,n2,count,a;
while(sacnf("%d%d",&n1,&n2)!=EOF){
count=0;
a=n1+n2;
while(a!=0){
a=a/10;
count++;
}
printf("%d",count);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:15: error: 'sacnf' was not declared in this scope; did you mean 'scanf'?
4 | while(sacnf("%d%d",&n1,&n2)!=EOF){
| ^~~~~
| scanf
|
s336864102
|
p00002
|
C++
|
#include <iostream>
using namespace std;
unsigned short digitsofnum(unsigned short n) {
int j = 0;
while (n > 0) {
n = n / 10;
j++;
}
return j;
}
int main()
{
unsigned short a, b;
vector<unsigned short> dst;
while (cin >> a >> b)
cout <<digitsofnum(a + b) << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:9: error: 'vector' was not declared in this scope
14 | vector<unsigned short> dst;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <iostream>
+++ |+#include <vector>
2 | using namespace std;
a.cc:14:16: error: expected primary-expression before 'unsigned'
14 | vector<unsigned short> dst;
| ^~~~~~~~
|
s185287638
|
p00002
|
C++
|
#coding:UTF-8
a=int(input())
b=int(input())
a+=b;
b=1
for num in range(1,8):
b*=10
if a<b:
print(num)
break
|
a.cc:1:2: error: invalid preprocessing directive #coding
1 | #coding:UTF-8
| ^~~~~~
a.cc:3:1: error: 'a' does not name a type
3 | a=int(input())
| ^
a.cc:7:1: error: 'b' does not name a type
7 | b=1
| ^
|
s658117525
|
p00002
|
C++
|
#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
int main()
{
int i1, i2;
cin >> i1 >> i2;
i1 += i2;
i2 = 0;
while (i1) {
i2++;
i1 /= 10;
}
cout << i2 << endl;
return 0;
}
|
a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s790193457
|
p00002
|
C++
|
#include<iostream>
#include<cmath>
using namespace std;
int main(void){
int a,b;
int ans;
while(1){
cin >> a >> b;
if(a==0 %% b==0)
break;
ans=log10(a+b)+1;
cout << ans << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:14:12: error: expected primary-expression before '%' token
14 | if(a==0 %% b==0)
| ^
|
s763212257
|
p00002
|
C++
|
#include<iostream>
using namespace std;
int main (){
int a,b,gou,p,i;
gou=0;
while(cin>>a>>b){
gou=a+b;
for(j=0;j<7;j++){
if(gou>0){
p++;
}
else if(gou<=0){
break;
}
gou=gou/10;
}
cout<<p<<endl;
p=0;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:21: error: 'j' was not declared in this scope
8 | for(j=0;j<7;j++){
| ^
|
s961477864
|
p00002
|
C++
|
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int a,b;
while(true)
{
a=cin.nextInt();
b=cin.nextInt();
if(a==0 && b==0) break;
String s = ((Integer)(a+b)).toString();
System.out.println(s.length());
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main
| ^~~~~~
|
s591889758
|
p00002
|
C++
|
import java.util.*;public class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);for(int t=s.nextInt();t-->0;){int[]l=new int[3];for(int i=0;i<3;i++)l[i]=s.nextInt();Arrays.sort(l);System.out.println(l[0]*l[0]+l[1]*l[1]==l[2]*l[2]?"YES":"NO");}}}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;public class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);for(int t=s.nextInt();t-->0;){int[]l=new int[3];for(int i=0;i<3;i++)l[i]=s.nextInt();Arrays.sort(l);System.out.println(l[0]*l[0]+l[1]*l[1]==l[2]*l[2]?"YES":"NO");}}}
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:1:20: error: expected unqualified-id before 'public'
1 | import java.util.*;public class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);for(int t=s.nextInt();t-->0;){int[]l=new int[3];for(int i=0;i<3;i++)l[i]=s.nextInt();Arrays.sort(l);System.out.println(l[0]*l[0]+l[1]*l[1]==l[2]*l[2]?"YES":"NO");}}}
| ^~~~~~
|
s472499809
|
p00002
|
C++
|
#include <stdio.h>
int keta();
int kuriagari();
int maxKeta();
int main(void)
{ //statusªEOFðÔµ½çAüÍI¹(ctrl+z)
int a,b,status,digit,temp;
do{
status=scanf("%d%d",&a,&b);
;temp=keta(a,b);
;digit=temp+kuriagari(a,b,temp);
if (status!=EOF){
printf("%d\n",keta(a+b));
}
}while(status!=EOF);
return 0;
}
int keta(int a){
int i=1,b=10;
while (a/10>0 || b/10>0){
a/=10;
b/=10;
i++;
}
return i;
}
int kuriagari(int a,int b,int i){
int aAmari,bAmari,hoge;
//maxKeta(a,&aAmari,i);
//maxKeta(b,&bAmari,i);
//printf ("%d
ÚF%dÆ%d\n",i,a,b);
//printf (" AÌ ÜèF%d BÌ ÜèF%d\n",aAmari,bAmari);
if (i==0){
return 0;
}else{
//printf("%d+%dÈÌÅ%dðԵܷB\n",maxKeta(a,&aAmari,i),maxKeta(b,&bAmari,i),hoge=(maxKeta(a,&aAmari,i)+maxKeta(b,&bAmari,i)+ kuriagari(a-aAmari,b-bAmari,i-1))/10);
return (maxKeta(a,&aAmari,i)+maxKeta(b,&bAmari,i)+ kuriagari(a-aAmari,b-bAmari,i-1))/10;
}
}
int maxKeta(int a,int *aAmari,int i){
int maxKetaA=a;
*aAmari=1;
for(;i>1;i--){
//printf("%d|",*aAmari);
maxKetaA/=10;
*aAmari*=10;
}
*aAmari*=maxKetaA;
return maxKetaA;
}
|
a.cc: In function 'int main()':
a.cc:12:27: error: too many arguments to function 'int keta()'
12 | ;temp=keta(a,b);
| ~~~~^~~~~
a.cc:3:5: note: declared here
3 | int keta();
| ^~~~
a.cc:13:38: error: too many arguments to function 'int kuriagari()'
13 | ;digit=temp+kuriagari(a,b,temp);
| ~~~~~~~~~^~~~~~~~~~
a.cc:4:5: note: declared here
4 | int kuriagari();
| ^~~~~~~~~
a.cc:15:43: error: too many arguments to function 'int keta()'
15 | printf("%d\n",keta(a+b));
| ~~~~^~~~~
a.cc:3:5: note: declared here
3 | int keta();
| ^~~~
a.cc: In function 'int kuriagari(int, int, int)':
a.cc:41:32: error: too many arguments to function 'int maxKeta()'
41 | return (maxKeta(a,&aAmari,i)+maxKeta(b,&bAmari,i)+ kuriagari(a-aAmari,b-bAmari,i-1))/10;
| ~~~~~~~^~~~~~~~~~~~~
a.cc:5:5: note: declared here
5 | int maxKeta();
| ^~~~~~~
a.cc:41:53: error: too many arguments to function 'int maxKeta()'
41 | return (maxKeta(a,&aAmari,i)+maxKeta(b,&bAmari,i)+ kuriagari(a-aAmari,b-bAmari,i-1))/10;
| ~~~~~~~^~~~~~~~~~~~~
a.cc:5:5: note: declared here
5 | int maxKeta();
| ^~~~~~~
|
s199959594
|
p00002
|
C++
|
import java.util.*;
class Main{
public static void main(String[] args){
Scanner scn = new Scanner(System.in);
int a,b;
for(;;){
a = scn.nextInt();
b = scn.nextInt();
int i = a + b;
int count = 1;
for(; i>=10;i/=10,count++);
System.out.println(count);
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
4 | public static void main(String[] args){
| ^~~~~~~
| :
a.cc:4:29: error: 'String' has not been declared
4 | public static void main(String[] args){
| ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'args'
4 | public static void main(String[] args){
| ^~~~
a.cc:21:2: error: expected ';' after class definition
21 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:9: error: 'Scanner' was not declared in this scope
5 | Scanner scn = new Scanner(System.in);
| ^~~~~~~
a.cc:9:21: error: 'scn' was not declared in this scope
9 | a = scn.nextInt();
| ^~~
a.cc:17:17: error: 'System' was not declared in this scope
17 | System.out.println(count);
| ^~~~~~
|
s390748085
|
p00002
|
C++
|
main(a,b){
for(;~scanf("%d%d",&a,&b);puts(&a))
a=log10(a+b)+49;
}
|
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(a,b){
| ^
|
s349615509
|
p00002
|
C++
|
#include "StdAfx.h"
#include <iostream>
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b){
int k=1,stac=a+b;
while(stac>10){
stac/=10;
k++;
}
cout<<k<<"\n";
}
}
|
a.cc:1:10: fatal error: StdAfx.h: No such file or directory
1 | #include "StdAfx.h"
| ^~~~~~~~~~
compilation terminated.
|
s720787528
|
p00002
|
C++
|
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fin(argc[1]);
int a,b;
int wa;
while( !fin.eof() ) {
int count = 0;
fin >> a >> b;
wa = a + b;
while(0){
if(wa / 10 == 0){
cout << count << endl;
break;
}
wa/=10;
count++;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:22: error: 'argc' was not declared in this scope
7 | ifstream fin(argc[1]);
| ^~~~
|
s315102340
|
p00002
|
C++
|
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int counts(string num) {
int count = 0;
for (int i = 0; i < ; i++) {
if (num[i] != "0") count++;
}
return count;
}
int main() {
for (int a, b; cin >> a >> b && a && b) {
string stream as;
as << a;
string stream bs;
bs << b;
cout << counts(as)+counts(bs) << endl;
}
}
|
a.cc: In function 'int counts(std::string)':
a.cc:9:29: error: expected primary-expression before ';' token
9 | for (int i = 0; i < ; i++) {
| ^
a.cc:10:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if (num[i] != "0") count++;
a.cc: In function 'int main()':
a.cc:16:47: error: expected ';' before ')' token
16 | for (int a, b; cin >> a >> b && a && b) {
| ^
| ;
a.cc:17:31: error: expected initializer before 'as'
17 | string stream as;
| ^~
a.cc:18:17: error: 'as' was not declared in this scope; did you mean 'a'?
18 | as << a;
| ^~
| a
a.cc:19:31: error: expected initializer before 'bs'
19 | string stream bs;
| ^~
a.cc:20:17: error: 'bs' was not declared in this scope; did you mean 'b'?
20 | bs << b;
| ^~
| b
|
s369255060
|
p00002
|
C++
|
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int counts(string num) {
int count = 0;
for (int i = 0; i < size(num); i++) {
if (num[i] != "0") count++;
}
return count;
}
int main() {
for (int a, b; cin >> a >> b && a && b) {
string stream as;
as << a;
string stream bs;
bs << b;
cout << counts(as)+counts(bs) << endl;
}
}
|
a.cc: In function 'int counts(std::string)':
a.cc:10:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if (num[i] != "0") count++;
a.cc: In function 'int main()':
a.cc:16:47: error: expected ';' before ')' token
16 | for (int a, b; cin >> a >> b && a && b) {
| ^
| ;
a.cc:17:31: error: expected initializer before 'as'
17 | string stream as;
| ^~
a.cc:18:17: error: 'as' was not declared in this scope; did you mean 'a'?
18 | as << a;
| ^~
| a
a.cc:19:31: error: expected initializer before 'bs'
19 | string stream bs;
| ^~
a.cc:20:17: error: 'bs' was not declared in this scope; did you mean 'b'?
20 | bs << b;
| ^~
| b
|
s446055049
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int counts(char[] num) {
int count = 0;
for (int i = 0; i < num.length; i++) {
if (num[i] != "0") count++;
}
return count;
}
int main() {
for (int a, b; cin >> a >> b && a && b) {
char[] as = (char[])a;
char[] bs = (char[])b;
cout << counts(as)+counts(bs) << endl;
}
}
|
a.cc:5:19: error: expected ',' or '...' before 'num'
5 | int counts(char[] num) {
| ^~~
a.cc: In function 'int counts(char*)':
a.cc:7:29: error: 'num' was not declared in this scope; did you mean 'enum'?
7 | for (int i = 0; i < num.length; i++) {
| ^~~
| enum
a.cc: In function 'int main()':
a.cc:14:47: error: expected ';' before ')' token
14 | for (int a, b; cin >> a >> b && a && b) {
| ^
| ;
a.cc:15:15: error: structured binding declaration cannot have type 'char'
15 | char[] as = (char[])a;
| ^~
a.cc:15:15: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:15:15: error: empty structured binding declaration
a.cc:15:18: error: expected initializer before 'as'
15 | char[] as = (char[])a;
| ^~
a.cc:16:15: error: structured binding declaration cannot have type 'char'
16 | char[] bs = (char[])b;
| ^~
a.cc:16:15: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:16:15: error: empty structured binding declaration
a.cc:16:18: error: expected initializer before 'bs'
16 | char[] bs = (char[])b;
| ^~
a.cc:17:32: error: 'as' was not declared in this scope; did you mean 'a'?
17 | cout << counts(as)+counts(bs) << endl;
| ^~
| a
a.cc:17:43: error: 'bs' was not declared in this scope; did you mean 'b'?
17 | cout << counts(as)+counts(bs) << endl;
| ^~
| b
|
s716340593
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main() {
for (int a, b; cin >> a >> b && a && b) {
a += b;
int count = 0;
for (; a > 0; a /= 10)
count++;
cout << count << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:6:47: error: expected ';' before ')' token
6 | for (int a, b; cin >> a >> b && a && b) {
| ^
| ;
|
s434730427
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main() {
for (int a, b; cin >> a >> b && a && b) {
a += b;
int count = 0;
for (; a > 0; a /= 10) {
count++;
}
cout << count << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:6:47: error: expected ';' before ')' token
6 | for (int a, b; cin >> a >> b && a && b) {
| ^
| ;
|
s510646843
|
p00002
|
C++
|
int toLowUnder10(int arg) {
return (10 > arg) ? arg : (toLowUnder10(arg/10) + 1) ;
}
int main (int argc, char *argv[]) {
int a,b;
while (EOF != fscanf(stdin, "%d %d", &a, &b)) {
printf("%d\n", toLowUnder10(a+b));
}
return 0;
}
|
a.cc: In function 'int main(int, char**)':
a.cc:7:16: error: 'EOF' was not declared in this scope
7 | while (EOF != fscanf(stdin, "%d %d", &a, &b)) {
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int toLowUnder10(int arg) {
a.cc:7:30: error: 'stdin' was not declared in this scope
7 | while (EOF != fscanf(stdin, "%d %d", &a, &b)) {
| ^~~~~
a.cc:7:30: note: 'stdin' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:7:23: error: 'fscanf' was not declared in this scope
7 | while (EOF != fscanf(stdin, "%d %d", &a, &b)) {
| ^~~~~~
a.cc:8:17: error: 'printf' was not declared in this scope
8 | printf("%d\n", toLowUnder10(a+b));
| ^~~~~~
a.cc:8:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s726398668
|
p00002
|
C++
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while(s.hasNext()) {
int sum = s.nextInt() + s.nextInt();
System.out.println(String.valueOf(sum).length());
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s664789068
|
p00002
|
C++
|
import java.util.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
while (read()) {
solve();
}
}
static int a, b;
static boolean read() {
if (!sc.hasNextInt()) return false;
a = sc.nextInt(); b = sc.nextInt();
return true;
}
static void solve() {
int sum = a + b, res = 0;
while (sum > 0) {
sum /= 10;
res++;
}
System.out.println(res);
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import static java.util.Arrays.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import static java.lang.Math.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
4 | public class Main {
| ^~~~~~
|
s987181685
|
p00002
|
C++
|
#include <iostream>
#include <string>
#include <stdio.h>
#include <strstream.h>
#include <math.h>
using namespace std;
int main()
{
string tmp;
int nspace;
do
{
getline(cin,tmp);
if(cin.eof()) break;
nspace=tmp.find(" ");
string astring=tmp.substr(0,nspace);
string bstring=tmp.substr(nspace+1);
istrstream astr(astring.data());
istrstream bstr(bstring.data());
int a,b;
astr>>a;
bstr>>b;
int a_keta=(int)log10(a)+1;
int b_keta=(int)log10(b)+1;
cout<<a_keta+b_keta;
}while(1);
return 0;
}
|
a.cc:4:10: fatal error: strstream.h: No such file or directory
4 | #include <strstream.h>
| ^~~~~~~~~~~~~
compilation terminated.
|
s178716842
|
p00002
|
C++
|
#include <iostream>
#include <string>
#include <strstream.h>
#include <math.h>
using namespace std;
int main()
{
string tmp;
int nspace;
do
{
if(cin.eof()) break;
getline(cin,tmp);
nspace=tmp.find(" ");
string astring=tmp.substr(0,nspace);
string bstring=tmp.substr(nspace+1);
istrstream astr(astring.data());
istrstream bstr(bstring.data());
int a,b;
astr>>a;
bstr>>b;
int a_keta=(int)log10(a)+1;
int b_keta=(int)log10(b)+1;
cout<<a_keta+b_keta;
}while(1);
return 0;
}
|
a.cc:3:10: fatal error: strstream.h: No such file or directory
3 | #include <strstream.h>
| ^~~~~~~~~~~~~
compilation terminated.
|
s398227121
|
p00002
|
C++
|
#include<cstdio>
int main(){
int a,b;
while(scanf("%d%d",&a,&b)){
print("%d\n",a+b);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:2: error: 'print' was not declared in this scope; did you mean 'printf'?
6 | print("%d\n",a+b);
| ^~~~~
| printf
|
s435081306
|
p00002
|
C++
|
#include <stdio.h>
int main(){
int a, b, c;
int keta;
while(cin >> a){
cin >> b;
c=a+b;
keta=1;
while((c/=10)>0) keta++;
printf("%d\n", keta);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | while(cin >> a){
| ^~~
|
s552340068
|
p00002
|
C++
|
#include <iostream>
int main(){
int a, b, c;
int keta;
while(cin >> a){
cin >> b;
c=a+b;
keta=1;
while((c/=10)>0) keta++;
printf("%d\n", keta);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | while(cin >> a){
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
|
s292880783
|
p00002
|
C++
|
#include <iostream>
int main(){
int a, b, c;
int keta;
while(cin >> a b){
c=a+b;
keta=1;
while((c/=10)>0) keta++;
printf("%d\n", keta);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | while(cin >> a b){
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:17: error: expected ')' before 'b'
7 | while(cin >> a b){
| ~ ^~
| )
a.cc:7:19: error: expected ';' before ')' token
7 | while(cin >> a b){
| ^
| ;
|
s830452807
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a, b, c;
int keta;
while(cin >> a){
cin >> b
c=a+b;
keta=1;
while((c/=10)>0) keta++;
printf("%d\n", keta);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:13: error: expected ';' before 'c'
9 | cin >> b
| ^
| ;
10 | c=a+b;
| ~
|
s736872952
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a, b, c;
int keta;
while(cin >> a){
cin >> b
c=a+b;
keta=1;
while((c/=10)>0) keta++;
cout << keta << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:13: error: expected ';' before 'c'
9 | cin >> b
| ^
| ;
10 | c=a+b;
| ~
|
s297721332
|
p00002
|
C++
|
<stdio.h>
main(){
int a,b,i,sum;
while(scanf("%d",&a)!=EOF){
scanf("%d",&b);
sum=a+b;
for(i=1;sum>1;i++)
sum=sum/10;
printf("%d\n",i);
}
return(0);
}
|
a.cc:1:1: error: expected unqualified-id before '<' token
1 | <stdio.h>
| ^
|
s977695304
|
p00002
|
C++
|
#include<stdio.h>
int main(){
int a,b,c;
while(~scanf("%d%d",&a,&b);){
c=0;
a+=b;
while(a){
a/=10;
c++;
}
printf("%d\n",c);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:28: error: expected ')' before ';' token
5 | while(~scanf("%d%d",&a,&b);){
| ~ ^
| )
a.cc:5:29: error: expected primary-expression before ')' token
5 | while(~scanf("%d%d",&a,&b);){
| ^
|
s398759931
|
p00002
|
C++
|
#include<stdio.h>
int main(){
char a[21];
char b[21];
int A;
int B;
int i;
int l=1;
fgets(ツ a,sizeof(a),stdinツ );
fgets(ツ b,sizeof(b),stdinツ );
sscanf(a,"%dツ”, &A);
sscanf(b,"%d", &B);
i=A+B;
while(i >= 10){
i=i/10;
l=l+1;
}
printf("%d" ,l);
}
|
a.cc:11:15: error: extended character is not valid in an identifier
11 | fgets(ツ a,sizeof(a),stdinツ );
| ^
a.cc:11:31: error: extended character is not valid in an identifier
11 | fgets(ツ a,sizeof(a),stdinツ );
| ^
a.cc:12:15: error: extended character is not valid in an identifier
12 | fgets(ツ b,sizeof(b),stdinツ );
| ^
a.cc:12:31: error: extended character is not valid in an identifier
12 | fgets(ツ b,sizeof(b),stdinツ );
| ^
a.cc:13:18: warning: missing terminating " character
13 | sscanf(a,"%dツ”, &A);
| ^
a.cc:13:18: error: missing terminating " character
13 | sscanf(a,"%dツ”, &A);
| ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:11:15: error: '\U000030c4\U00003000a' was not declared in this scope
11 | fgets(ツ a,sizeof(a),stdinツ );
| ^~~~~
a.cc:11:31: error: 'stdin\U000030c4\U00003000' was not declared in this scope
11 | fgets(ツ a,sizeof(a),stdinツ );
| ^~~~~~~~~
a.cc:12:15: error: '\U000030c4\U00003000b' was not declared in this scope
12 | fgets(ツ b,sizeof(b),stdinツ );
| ^~~~~
a.cc:14:27: error: expected ')' before ';' token
14 | sscanf(b,"%d", &B);
| ^
| )
a.cc:13:15: note: to match this '('
13 | sscanf(a,"%dツ”, &A);
| ^
|
s209767467
|
p00002
|
C++
|
#include<stdio.h>
int main(){
char a[21];
char b[21];
int A;
int B;
int i;
int l=1;
fgets(a,sizeof(a),stdin);
fgets(b,sizeof(b),stdin);
sscanf(a,"%dツ”, &A);
sscanf(b,"%d", &B);
i=A+B;
while(i >= 10){
i=i/10;
l=l+1;
}
printf("%d" ,l);
}
|
a.cc:13:18: warning: missing terminating " character
13 | sscanf(a,"%dツ”, &A);
| ^
a.cc:13:18: error: missing terminating " character
13 | sscanf(a,"%dツ”, &A);
| ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:14:27: error: expected ')' before ';' token
14 | sscanf(b,"%d", &B);
| ^
| )
a.cc:13:15: note: to match this '('
13 | sscanf(a,"%dツ”, &A);
| ^
|
s911301585
|
p00002
|
C++
|
#include<stdio.h>
int main(){
char a[21];
char b[21];
int A;
int B;
int i;
int l=1;
fgets(a,sizeof(a),stdin);
fgets(b,sizeof(b),stdin);
sscanf(a,"%dツ”, &A);
sscanf(b,"%d", &B);
i=A+B;
while(i >= 10){
i=i/10;
l=l+1;
}
printf("%d" ,l);
}
|
a.cc:13:18: warning: missing terminating " character
13 | sscanf(a,"%dツ”, &A);
| ^
a.cc:13:18: error: missing terminating " character
13 | sscanf(a,"%dツ”, &A);
| ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:14:27: error: expected ')' before ';' token
14 | sscanf(b,"%d", &B);
| ^
| )
a.cc:13:15: note: to match this '('
13 | sscanf(a,"%dツ”, &A);
| ^
|
s210444745
|
p00002
|
C++
|
#include<stdio.h>
int main(void){
char a[21];
char b[21];
int A;
int B;
int i;
int l=1;
fgets(a,sizeof(a),stdin);
fgets(b,sizeof(b),stdin);
sscanf(a,"%dツ”, &A);
sscanf(b,"%d", &B);
i=A+B;
while(i >= 10){
i=i/10;
l=l+1;
}
printf("%d" ,l);
}
|
a.cc:13:18: warning: missing terminating " character
13 | sscanf(a,"%dツ”, &A);
| ^
a.cc:13:18: error: missing terminating " character
13 | sscanf(a,"%dツ”, &A);
| ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:14:27: error: expected ')' before ';' token
14 | sscanf(b,"%d", &B);
| ^
| )
a.cc:13:15: note: to match this '('
13 | sscanf(a,"%dツ”, &A);
| ^
|
s274644097
|
p00002
|
C++
|
File Edit Options Buffers Tools C++ Development Help
#include<iostream>
#include<stdio.h>
int main(void){
int x,y,z,keta=0;
scanf("%d %d",&x,&y);
z =x+y;
while(z>0){
z = z/10;
keta++;
}
std::cout << keta << std::endl;
return 0;
}
|
a.cc:1:1: error: 'File' does not name a type
1 | File Edit Options Buffers Tools C++ Development Help
| ^~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function
179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mea
|
s726313104
|
p00002
|
C++
|
#include<iostream>
#include<stdio.h>
int main(void){
int x,y,z,keta=0;
scanf("%d %d",&x,&y);
z =x+y;
while(z>0){
z = z/10;
keta++;
}
std::cout << keta << std::endl;
return 0;
} #include<iostream>
#include<stdio.h>
int main(void){
int x,y,z,keta=0;
scanf("%d %d",&x,&y);
z =x+y;
while(z>0){
z = z/10;
keta++;
}
std::cout << keta << std::endl;
return 0;
}
|
a.cc:15:5: error: stray '#' in program
15 | } #include<iostream>
| ^
a.cc:15:6: error: 'include' does not name a type
15 | } #include<iostream>
| ^~~~~~~
|
s596731664
|
p00002
|
C++
|
#include<stdio.h>
int main(void){
int x,y,z,keta=0;
scanf("%d %d",&x,&y);
z =x+y;
while(z>0){
z = z/10;
keta++;
}
std::cout << keta << std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:8: error: 'cout' is not a member of 'std'
12 | std::cout << keta << std::endl;
| ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<stdio.h>
+++ |+#include <iostream>
2 |
a.cc:12:29: error: 'endl' is not a member of 'std'
12 | std::cout << keta << std::endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include<stdio.h>
+++ |+#include <ostream>
2 |
|
s013991352
|
p00002
|
C++
|
include<iostream>
int main(void){
int a,b,c,i=0;
std::cin >> a >> b;
c =a+b;
FLAG:
c =c/10;
i++;
if(0<c){
goto FLAG;
}
std::cout << i << std::endl;
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
|
s537038200
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main() {
__int64 a, b, c;
int x;
bool flg = true;
while (1) {
cin>>a;
if (a==EOF)
break;
c=a+b;
x = 1;
flg = true;
while (flg) {
if ((c=c/10)>0)
x++;
else
flg = false;
}
cout<<x<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
5 | __int64 a, b, c;
| ^~~~~~~
| __int64_t
a.cc:10:22: error: 'a' was not declared in this scope
10 | cin>>a;
| ^
a.cc:14:17: error: 'c' was not declared in this scope
14 | c=a+b;
| ^
a.cc:14:21: error: 'b' was not declared in this scope
14 | c=a+b;
| ^
|
s170009731
|
p00002
|
C++
|
c[];main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d",sprintf(c,"%d",a+b)));}
|
a.cc:1:1: error: 'c' does not name a type
1 | c[];main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d",sprintf(c,"%d",a+b)));}
| ^
a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token
1 | c[];main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d",sprintf(c,"%d",a+b)));}
| ^
|
s370510367
|
p00002
|
C++
|
main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(&a,"%d",a+b)));}
|
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(&a,"%d",a+b)));}
| ^
|
s646232705
|
p00002
|
C++
|
a;main(b){for(;~scanf("%d%d",&a,&b);printf("%d\n",log10(a+b)+1));}
|
a.cc:1:1: error: 'a' does not name a type
1 | a;main(b){for(;~scanf("%d%d",&a,&b);printf("%d\n",log10(a+b)+1));}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | a;main(b){for(;~scanf("%d%d",&a,&b);printf("%d\n",log10(a+b)+1));}
| ^
|
s448374523
|
p00002
|
C++
|
#include <iostream>
#include <cstdio>
using namespace std;
int digit(int num){
if((num / 10) > 0){
return (digit(num/10))+1;
}
else return 1;
}
int main(){
int num1,num2,result=0;
char buf[256];
while(1){
gets(buf);
if(buf[0] == '\0')break;
num1 = 0;
num2 = 0;
sprintf(buf,"%d %d",num1,num2);
result += digit(num1);
result += digit(num2);
cout << result << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
17 | gets(buf);
| ^~~~
| getw
|
s623357525
|
p00002
|
C++
|
#include <stdio.h>
int ketasu(int atai){
int result = 0;
for(atai != 0){
result++;
atai = atai / 10;
}
return result;
}
int main(){
int a, b;
while(scanf("%d %d",&a, &b) != EOF) printf("%d\n", ketasu(a + b));
return 0;
}
|
a.cc: In function 'int ketasu(int)':
a.cc:4:22: error: expected ';' before ')' token
4 | for(atai != 0){
| ^
| ;
a.cc:8:9: error: expected primary-expression before 'return'
8 | return result;
| ^~~~~~
a.cc:7:10: error: expected ';' before 'return'
7 | }
| ^
| ;
8 | return result;
| ~~~~~~
a.cc:8:9: error: expected primary-expression before 'return'
8 | return result;
| ^~~~~~
a.cc:7:10: error: expected ')' before 'return'
7 | }
| ^
| )
8 | return result;
| ~~~~~~
a.cc:4:12: note: to match this '('
4 | for(atai != 0){
| ^
a.cc:9:1: warning: control reaches end of non-void function [-Wreturn-type]
9 | }
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.