submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s496174489 | p03635 | Java | public class Main{
public static void main(String[]args){
int n = java.util.Random().nextInt(98)+2;
int m = java.util.Random().nextInt(98)+2;
int k= (n-1)*(m-1);
System.out.println(k);
}
} | Main.java:3: error: cannot find symbol
int n = java.util.Random().nextInt(98)+2;
^
symbol: class util
location: package java
Main.java:4: error: cannot find symbol
int m = java.util.Random().nextInt(98)+2;
^
symbol: class util
location: package java
2 errors
|
s440032737 | p03635 | C++ | #include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
cout >> (n-1)*(m-1);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
8 | cout >> (n-1)*(m-1);
| ~~~~ ^~ ~~~~~~~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:8:8: note: candidate: 'operator>>(int, int)' (built-in)
8 | cout >> (n-1)*(m-1);
| ~~~~~^~~~~~~~~~~~~~
a.cc:8:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55,
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/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | cout >> (n-1)*(m-1);
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:8:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
8 | cout >> (n-1)*(m-1);
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | cout >> (n-1)*(m-1);
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> (n-1)*(m-1);
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> (n-1)*(m-1);
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | cout >> (n-1)*(m-1);
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> (n-1)*(m-1);
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> (n-1)*(m-1);
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int]':
a.cc:8:21: required from here
8 | cout >> (n-1)*(m-1);
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
s990949515 | p03635 | Java | import java.util.*;
public class Solution {
public static void main(String args[]){
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int m = input.nextInt();
System.out.println((n-1)*(m-1));
}
}
| Main.java:2: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
^
1 error
|
s591130734 | p03635 | Java | public class main{
public static void main(String[]args){
int n = new java.util.Scanner(System.in).nextInt();
int m = new java.util.Scanner(System.in).nextInt();
int k= (n-1)*(m-1);
System.out.println(k);
}
} | Main.java:1: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s232400044 | p03635 | Java |
public static void main(String args){
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int m = input.nextInt();
System.out.println((n-1)*(m-1));
}
| Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String args){
^
(use --enable-preview to enable unnamed classes)
1 error
|
s140955848 | p03635 | Java | public class main{
public static void main(String[]args){
int n = new.java.util.Scanner().nextInt();
int m = new.java.util.Scanner().nextInt();
int k= (n-1)*(m-1);
System.out.println(k);
}
} | Main.java:3: error: <identifier> expected
int n = new.java.util.Scanner().nextInt();
^
Main.java:4: error: <identifier> expected
int m = new.java.util.Scanner().nextInt();
^
2 errors
|
s947256403 | p03635 | Java | import java.util.*;
public class Solution {
public static void main(String args){
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int m = input.nextInt();
System.out.println((n-1)*(m-1));
}
}
| Main.java:2: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
^
1 error
|
s171335646 | p03635 | C++ | #include <cstdio>
#include <iostream>
using namespace std;
}
int main()
{
int n,m,c;
while(cin>>n>>m)
{
c=n*m;
cout<<c<<endl;
}
return 0;
}
| a.cc:6:1: error: expected declaration before '}' token
6 | }
| ^
|
s749743138 | p03635 | C | #include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
printf("(a-1)*(b-1)\n"a,b);
} | main.c: In function 'main':
main.c:8:23: error: expected ')' before 'a'
8 | printf("(a-1)*(b-1)\n"a,b);
| ~ ^
| )
|
s684615666 | p03635 | C++ | n,m=gets.split.map &:to_i
p -~n*-~m | a.cc:1:1: error: 'n' does not name a type
1 | n,m=gets.split.map &:to_i
| ^
|
s035540063 | p03635 | C | #include <stdio.h>
int main(void){
int n,m;
scanf("%d %d",&n,&m);
printf("%d",(n-1)*(m-1);
return 0;
} | main.c: In function 'main':
main.c:5:32: error: expected ')' before ';' token
5 | printf("%d",(n-1)*(m-1);
| ~ ^
| )
main.c:6:18: error: expected ';' before '}' token
6 | return 0;
| ^
| ;
7 | }
| ~
|
s512215209 | p03635 | C++ | #include <iostream>
#include <vector>
#include <string >
#include <set>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
cout << (n-1)*(m-1) << endl;
return 0;
}
| a.cc:3:10: fatal error: string : No such file or directory
3 | #include <string >
| ^~~~~~~~~
compilation terminated.
|
s890366082 | p03635 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin>>n>m;
cout<<(n-1)*(m-1);
return 0;
} | a.cc: In function 'int main()':
a.cc:10:15: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
10 | cin>>n>m;
| ~~~~~~^~
| | |
| | int
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:10:15: note: candidate: 'operator>(int, int)' (built-in)
10 | cin>>n>m;
| ~~~~~~^~
a.cc:10:15: 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:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | cin>>n>m;
| ^
/usr/include/c++/14/bits/regex.h:1236: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>&)'
1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed:
a.cc:10:16: 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>'
10 | cin>>n>m;
| ^
/usr/include/c++/14/bits/regex.h:1329: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>&)'
1329 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | cin>>n>m;
| ^
/usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
10 | cin>>n>m;
| ^
/usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1497 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | cin>>n>m;
| ^
/usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
10 | cin>>n>m;
| ^
/usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1673 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | cin>>n>m;
| ^
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:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
10 | cin>>n>m;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | cin>>n>m;
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | cin>>n>m;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | cin>>n>m;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | cin>>n>m;
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
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:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
10 | cin>>n>m;
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
10 | cin>>n>m;
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
10 | cin>>n>m;
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_C |
s352347961 | p03635 | C++ | #include <iostream>
2 #include <cstdio>
3 #include <algorithm>
4 #include <cmath>
5 #include <vector>
6
7 using namespace std;
8
9 int main() {
10
11 int n, m;
12 cin >> n >> m;
13 cout << (n - 1) * (m - 1) << endl;
14
15 return 0;
16 }
| a.cc:2:5: error: stray '#' in program
2 | 2 #include <cstdio>
| ^
a.cc:3:5: error: stray '#' in program
3 | 3 #include <algorithm>
| ^
a.cc:4:5: error: stray '#' in program
4 | 4 #include <cmath>
| ^
a.cc:5:5: error: stray '#' in program
5 | 5 #include <vector>
| ^
a.cc:2:3: error: expected unqualified-id before numeric constant
2 | 2 #include <cstdio>
| ^
a.cc:8:3: error: expected unqualified-id before numeric constant
8 | 8
| ^
|
s809712069 | p03635 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define pb push_back
int main(){
string s;
int a,b,c,d,e;
cin>>a>>b;
cout<<(a-1)*(b-1)<<endl;
return 0;
}#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define pb push_back
int main(){
string s;
int a,b,c,d,e;
cin>>a>>b;
cout<<(a-1)*(b-1)<<endl;
return 0;
} | a.cc:17:2: error: stray '#' in program
17 | }#include<bits/stdc++.h>
| ^
a.cc:17:3: error: 'include' does not name a type
17 | }#include<bits/stdc++.h>
| ^~~~~~~
a.cc:24:5: error: redefinition of 'int main()'
24 | int main(){
| ^~~~
a.cc:8:5: note: 'int main()' previously defined here
8 | int main(){
| ^~~~
|
s476188680 | p03635 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(li i=0;i<(n);i++)
#define red(i,n) for(li i=(n)-1;i>=0;i--)
#define all(a) begin(a),end(a)
#define pb(a) push_back(a)
using namespace std;
using ll = long long;
using vi = vector<li>;
using vs = vector<string>;
int main()
{
ll a,b;
cin>>a>>b;
cout<<(a-1)*(b-1)<<endl;
return 0;
}
| a.cc:8:19: error: 'li' was not declared in this scope; did you mean 'll'?
8 | using vi = vector<li>;
| ^~
| ll
a.cc:8:21: error: template argument 1 is invalid
8 | using vi = vector<li>;
| ^
a.cc:8:21: error: template argument 2 is invalid
|
s022477991 | p03636 | C++ | #include <string>
#include <iostream>
using namespace std;
int main()
{
string s;
cin >> s;
cotu << s[0] << s.length()-2 << s[s.length()-1];
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: 'cotu' was not declared in this scope
8 | cotu << s[0] << s.length()-2 << s[s.length()-1];
| ^~~~
|
s211449277 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int a;
string s;
cin >> s;
a = s.size();
cout << s.[0] << a-2 << s.[a-1] << endl;
}
| a.cc: In function 'int main()':
a.cc:9:13: error: expected unqualified-id before '[' token
9 | cout << s.[0] << a-2 << s.[a-1] << endl;
| ^
a.cc:9:29: error: expected unqualified-id before '[' token
9 | cout << s.[0] << a-2 << s.[a-1] << endl;
| ^
|
s385428202 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
} | a.cc: In function 'int main()':
a.cc:7:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ~~~~ ^~~~~~~~~
| | |
| | __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
| std::ostream {aka std::basic_ostream<char>}
a.cc:7:8: note: candidate: 'operator>>(int, int)' (built-in)
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ~~~~~^~~~~~~~~
a.cc:7:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:7:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = char&]':
a.cc:7:16: required from here
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >>s.at(0)>>s.size()>>s.at(s.size())>>endl;
| ^
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:7 |
s576835918 | p03636 | C++ | v#include <bits/stdc++.h>
using namespace std;
//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
template <class T>
T GCD(T a, T b)
{
T r;
while (a)
r = b, b = a, a = r % a;
return b;
}
template <class T>
T LCM(T a, T b) { return a / GCD(a, b) * b; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repd(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (b); i--)
#define FORA(i, I) for (const auto &i : I)
// vector
#define ALL(x) x.begin(), x.end()
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef vector<ll> vl;
#define ERASE(x) x.erase(unique(ALL(x)), x.end()); // erase same elements
#define VEC(type, c, n) \
std::vector<type> c(n); \
for (auto &i : c) \
std::cin >> i;
// input
#define INIT \
std::ios::sync_with_stdio(false); \
std::cin.tie(0);
#define VAR(type, ...) \
type __VA_ARGS__; \
MACRO_VAR_Scan(__VA_ARGS__);
// output
template <typename T>
void MACRO_OUT(const T t) { std::cout << t; }
#define OUT(...) MACRO_OUT(__VA_ARGS__);
#define SP std::cout << " ";
#define TAB std::cout << "\t";
#define BR std::cout << "\n";
#define ENDL std::cout << std::endl;
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define yes() printf("yes\n")
#define no() printf("no\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
cout << a;
ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
cout << a << ' ';
}
ll ans = 0;
bool check = 0;
string s, t;
int N = 3;
vector<int> v(N);
int a, b, c, d, n;
int x, y;
int sum;
char ch;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// cout << (conditon ? (result: == 1 ): (==0)) << endl; <- output result of if
// long long 型が表せる値の上限はおよそ 9 × 10^18 です.
int main()
{
INIT;
cin >> s;
cout << s[0] << s.length() - 2 << s[s.length() - 1] << endl;
return 0;
}
| a.cc:1:2: error: stray '#' in program
1 | v#include <bits/stdc++.h>
| ^
a.cc:1:1: error: 'v' does not name a type
1 | v#include <bits/stdc++.h>
| ^
a.cc:6:9: error: 'pair' does not name a type
6 | typedef pair<int, int> P;
| ^~~~
a.cc:43:9: error: 'vector' does not name a type
43 | typedef vector<int> vi;
| ^~~~~~
a.cc:44:9: error: 'vector' does not name a type
44 | typedef vector<string> vs;
| ^~~~~~
a.cc:45:9: error: 'vector' does not name a type
45 | typedef vector<vi> vvi;
| ^~~~~~
a.cc:46:9: error: 'vector' does not name a type
46 | typedef vector<ll> vl;
| ^~~~~~
a.cc: In function 'void MACRO_OUT(T)':
a.cc:63:34: error: 'cout' is not a member of 'std'
63 | void MACRO_OUT(const T t) { std::cout << t; }
| ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | v#include <bits/stdc++.h>
a.cc: In function 'void pr(A)':
a.cc:82:5: error: 'cout' was not declared in this scope
82 | cout << a;
| ^~~~
a.cc: In function 'void pr(A, B)':
a.cc:88:5: error: 'cout' was not declared in this scope
88 | cout << a << ' ';
| ^~~~
a.cc: At global scope:
a.cc:93:1: error: 'string' does not name a type
93 | string s, t;
| ^~~~~~
a.cc:95:1: error: 'vector' does not name a type
95 | vector<int> v(N);
| ^~~~~~
a.cc: In function 'int main()':
a.cc:55:10: error: 'std::ios' has not been declared
55 | std::ios::sync_with_stdio(false); \
| ^~~
a.cc:107:5: note: in expansion of macro 'INIT'
107 | INIT;
| ^~~~
a.cc:56:10: error: 'cin' is not a member of 'std'
56 | std::cin.tie(0);
| ^~~
a.cc:107:5: note: in expansion of macro 'INIT'
107 | INIT;
| ^~~~
a.cc:56:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
56 | std::cin.tie(0);
| ^~~
a.cc:107:5: note: in expansion of macro 'INIT'
107 | INIT;
| ^~~~
a.cc:108:5: error: 'cin' was not declared in this scope
108 | cin >> s;
| ^~~
a.cc:108:12: error: 's' was not declared in this scope
108 | cin >> s;
| ^
a.cc:109:5: error: 'cout' was not declared in this scope
109 | cout << s[0] << s.length() - 2 << s[s.length() - 1] << endl;
| ^~~~
a.cc:109:60: error: 'endl' was not declared in this scope
109 | cout << s[0] << s.length() - 2 << s[s.length() - 1] << endl;
| ^~~~
|
s025244106 | p03636 | C++ | #include "bits/stdc++.h"
using namespace std;
char s[100], a, b;
int len = 0, len1 = 0;
int main()
{
cin>>s;
for(int i=0; i < strlen(s); i++)
{
len1 = strlen(s)-2;
len = strlen(s);
a = s[0];
b = s[len-1];
}
cout << a << len1 << b < <endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:34: error: expected primary-expression before '<' token
15 | cout << a << len1 << b < <endl;
| ^
|
s379607728 | p03636 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
string s;
cin >> s;
int slen = s.size() - 2;
cout << s.substr(1) + (string)slen + s.substr(-1) << endl;
}
| a.cc: In function 'int main()':
a.cc:14:35: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)'
14 | cout << s.substr(1) + (string)slen + s.substr(-1) << endl;
| ^~~~
In file included 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,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
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/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:14:35: note: cannot convert 'slen' (type 'int') to type 'const char*'
14 | cout << s.substr(1) + (string)slen + s.substr(-1) << endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&'
682 | basic_string(basic_string&& __str) noexcept
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
552 | basic_string(const basic_string& __str)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
552 | basic_string(const basic_string& __str)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14 |
s015309760 | p03636 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
string s;
cin >> s;
int slen = s.size() - 2;
cout << s.substr(1) + slen + s.substr(-1) << endl;
}
| a.cc: In function 'int main()':
a.cc:14:25: error: no match for 'operator+' (operand types are 'std::__cxx11::basic_string<char>' and 'int')
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ~~~~~~~~~~~ ^ ~~~~
| | |
| | int
| std::__cxx11::basic_string<char>
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/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:14:27: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
In file included 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:
/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:14:27: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: mismatched types 'const _CharT*' and 'int'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: mismatched types 'const _CharT*' and 'int'
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
/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:14:27: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
14 | cout << s.substr(1) + slen + s.substr(-1) << endl;
| ^~~~
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const c |
s420245744 | p03636 | C++ | #include "pch.h"
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s, ans;
cin >> s;
ans = s.substr(1, s.size() - 1);
cout << s.substr(0, 1) << ans.size() - 1 << s.substr(s.size() - 1, 1) << endl;
}
| a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s294790746 | p03636 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
int n = s.size();
cout << s[0] + str(n-2) + s[n-1] << endl;
} | a.cc: In function 'int main()':
a.cc:9:24: error: 'str' was not declared in this scope; did you mean 'std'?
9 | cout << s[0] + str(n-2) + s[n-1] << endl;
| ^~~
| std
|
s609349514 | p03636 | C++ | #include <iostream>
#include <string>
int main(){
string s;
cin>>s;
cout<<s[0]<<(s.length()-2)<<s[s.length()-1]<<endl;
} | a.cc: In function 'int main()':
a.cc:5:7: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:5:7: 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:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>s;
| ^~~
| 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:12: error: 's' was not declared in this scope
6 | cin>>s;
| ^
a.cc:7:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout<<s[0]<<(s.length()-2)<<s[s.length()-1]<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:7:52: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | cout<<s[0]<<(s.length()-2)<<s[s.length()-1]<<endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s866387358 | p03636 | C++ | #include <iostream>
#include <string>
int main(){
sting s;
cin>>s;
cout<<s[0]<<(s.length()-2)<<s[s.length()-1]<<endl;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'sting' was not declared in this scope
5 | sting s;
| ^~~~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>s;
| ^~~
| 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:6:8: error: 's' was not declared in this scope
6 | cin>>s;
| ^
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout<<s[0]<<(s.length()-2)<<s[s.length()-1]<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:7:48: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | cout<<s[0]<<(s.length()-2)<<s[s.length()-1]<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s764818914 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a, b;
cin>>a>>b;
cout<<a*b/2
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:14: error: expected ';' before 'return'
9 | cout<<a*b/2
| ^
| ;
10 |
11 | return 0;
| ~~~~~~
|
s277512925 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mp(a,b) make_pair(a,b)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
const int MOD=1000000007;
int main(){
string s;
cin>>s;
int n=s.length();
cout<<s[0];
cout<<n-2;
cout<<s[n-1]<<endl; | a.cc: In function 'int main()':
a.cc:18:22: error: expected '}' at end of input
18 | cout<<s[n-1]<<endl;
| ^
a.cc:12:11: note: to match this '{'
12 | int main(){
| ^
|
s167197060 | p03636 | C++ | #include <iostream>
#include <string.h>
#include <string>
using namespace std;
void a_already2018(void) {
string s;
cin >> s;
s[3] = '8';
cout << s << endl;
}
void b_i18n(void) {
string s;
cin >> s;
int word_len = s.size()-2;
string s_out = s[0] + to_string(word_len) + s[s.size() - 1];
cout << s_out << endl;
} | /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
|
s316096891 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string;
cin >> s;
cout << s[0] + (s.size() - 2) + s[-1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:3: error: declaration does not declare anything [-fpermissive]
6 | string;
| ^~~~~~
a.cc:7:10: error: 's' was not declared in this scope
7 | cin >> s;
| ^
|
s975300783 | p03636 | C++ | #include <iostream>
using namespace std;
int main(){
string s; cin >> s;
int len = s.size();
cout << s[0];
cout << n-2;
cout << s[n-1] << endl;
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'n' was not declared in this scope
9 | cout << n-2;
| ^
|
s779846971 | p03636 | C++ |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
string s; cin >> s;
cout << s[0] << s.size() - 2 << s[n-1] << endl;
} | a.cc: In function 'int main()':
a.cc:8:39: error: 'n' was not declared in this scope
8 | cout << s[0] << s.size() - 2 << s[n-1] << endl;
| ^
|
s249392739 | p03636 | C | /* ex6_2
tamayama */
#include<stdio.h>
#define SIZE 101
int main(void){
char str1[SIZE]; /*文字列の配列を用意*/
int i;
int count=0;
char first;
char final;
for(i=0;i<SIZE;i++){ /*ヌル文字を挿入*/
str1[i] = '\0';
}
scanf("%s",str1); /*入力された文字数をカウントする*/
for(i=0;i<SIZE;i++){
if(str1[i] != '\0'){
count++;
}
}
first = str1[0]; /*最初の文字*/
final = str1[count-1]; /*最後の文字*/
printf("%c%d%c\n",first,count-2,last); /*真ん中の文字数は、(全体の文字数)-2*/
return 0;
}
| main.c: In function 'main':
main.c:26:37: error: 'last' undeclared (first use in this function)
26 | printf("%c%d%c\n",first,count-2,last); /*真ん中の文字数は、(全体の文字数)-2*/
| ^~~~
main.c:26:37: note: each undeclared identifier is reported only once for each function it appears in
|
s584091190 | p03636 | C | /* ex_6-2. nknm */
#include <stdio.h>
#include <string.h>
int main(void){
int word_num, i;
char imput[100];
scanf("%s", imput);
word_num = int strlen(imput);
printf("%c %d %c\n", imput[0], word_num - 2, imput[word_num - 1]);
return 0;
} | main.c: In function 'main':
main.c:13:16: error: expected expression before 'int'
13 | word_num = int strlen(imput);
| ^~~
|
s441159938 | p03636 | C | /* ex_6-2. nknm */
#include <stdio.h>
#include <string.h>
int main(void){
int word_num, i;
char imput[100];
scanf("%s", imput);
printf("%c %d %c", imput[0], int strlen(imput) - 2, imput[int strlen(imput) - 1]);
return 0;
} | main.c: In function 'main':
main.c:13:34: error: expected expression before 'int'
13 | printf("%c %d %c", imput[0], int strlen(imput) - 2, imput[int strlen(imput) - 1]);
| ^~~
|
s812702380 | p03636 | C | /* ex6_2
hangan2020 */
#include <stdio.h>
#include <string.h>
#define IS 102 //Initial string array length
int main(void){
char eng_str[IS] = {};
int len, inbetween_no;
//Input character string (including null)
fgets(eng_str, IS, stdin);
len = strlen(eng_str);
inbetween_no = len - 3; // String length include null at the end of string (thus -3)
//Print out in the followning order
printf("%c%d%c\n", eng_str[0], inbetween_no, eng_str[len - 2]);
return 0;
}
| main.c: In function 'main':
main.c:6:15: error: stray '\343' in program
6 | #define IS 102<U+3000>//Initial string array length
| ^~~~~~~~
main.c:9:18: note: in expansion of macro 'IS'
9 | char eng_str[IS] = {};
| ^~
main.c:6:15: error: stray '\343' in program
6 | #define IS 102<U+3000>//Initial string array length
| ^~~~~~~~
main.c:13:20: note: in expansion of macro 'IS'
13 | fgets(eng_str, IS, stdin);
| ^~
|
s412283425 | p03636 | C | /* ex6_2
potter0723sw */
#include <stdio.h>
#include <string.h>
int main(void){
int num、last;
char string[101];//ヌル文字分含め確保
scanf("%s", &string);
num = (int)strlen(string) - 2;//省略するのは最初と最後以外
last = (int)strlen(string) - 1;//ヌル文字に注意
printf("%c%d%c\n", string[1], num, string[last]);
return 0;
} | main.c: In function 'main':
main.c:8:12: error: stray '\343' in program
8 | int num<U+3001>last;
| ^~~~~~~~
main.c:8:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'last'
8 | int num、last;
| ^~~~
main.c:8:14: error: 'last' undeclared (first use in this function)
main.c:8:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:5: error: 'num' undeclared (first use in this function)
11 | num = (int)strlen(string) - 2;//省略するのは最初と最後以外
| ^~~
|
s742437520 | p03636 | C | /* ex6_2
potter0723sw */
#include <stdio.h>
#include <string.h>
int main(void){
int num;
char string[101];//ヌル文字分含め確保
scanf("%s", &formula);
num = (int)strlen(string) - 2;//省略するのは最初と最後以外
printf("%c%d%c\n", string[1], num, string[(int)strlen(string)]);
return 0;
}
| main.c: In function 'main':
main.c:10:18: error: 'formula' undeclared (first use in this function)
10 | scanf("%s", &formula);
| ^~~~~~~
main.c:10:18: note: each undeclared identifier is reported only once for each function it appears in
|
s287200139 | p03636 | C++ | #include<stdio.h>
#include<stlib.h>
#define SIZE 101
int main(void)
{
int length;
char message[SIZE];
fgets(message, SIZE, stdin);
length = strlen(message);
printf("%c%d%c",message[0], length - 2, message[length-1]);
return 0;
} | a.cc:2:9: fatal error: stlib.h: No such file or directory
2 | #include<stlib.h>
| ^~~~~~~~~
compilation terminated.
|
s112749368 | p03636 | C | #include <stdio.h>
#include <string.h>
int main(void){
char sentence[101];
int between;
scanf("%s",sentence);
between = strlen(sentence) - 2;
strcat(sentence[0],between,sentence[strlen(sentence)-1]);
printf("%s\n",sentence[0]);
return 0;
} | main.c: In function 'main':
main.c:8:18: error: passing argument 1 of 'strcat' makes pointer from integer without a cast [-Wint-conversion]
8 | strcat(sentence[0],between,sentence[strlen(sentence)-1]);
| ~~~~~~~~^~~
| |
| char
In file included from main.c:2:
/usr/include/string.h:149:39: note: expected 'char * restrict' but argument is of type 'char'
149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
| ~~~~~~~~~~~~~~~~~^~~~~~
main.c:8:22: error: passing argument 2 of 'strcat' makes pointer from integer without a cast [-Wint-conversion]
8 | strcat(sentence[0],between,sentence[strlen(sentence)-1]);
| ^~~~~~~
| |
| int
/usr/include/string.h:149:70: note: expected 'const char * restrict' but argument is of type 'int'
149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
main.c:8:3: error: too many arguments to function 'strcat'
8 | strcat(sentence[0],between,sentence[strlen(sentence)-1]);
| ^~~~~~
/usr/include/string.h:149:14: note: declared here
149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
| ^~~~~~
|
s271980989 | p03636 | C | /* ex6_1
kosaq */
#include <stdio.h>
#include <string.h>
#define SIZE 101//十分な要素数
int main(void){
char string_s[SIZE];//入力に使う文字列を定義
int number_total;//全文字数を定義
scanf("%s", string_s);//文字列を入力
number_total = strlen(string_s);//全文字数は入力された文字列の長さに等しい
printf("%c %d %c\n", string_s[0], number_total - 2, string_s[i - 1]);
//string_s[0]は先頭の文字を出力、number_total - 2は間の文字数を出力、string_s[i - 1]は最後の文字を出力
return 0;
} | main.c: In function 'main':
main.c:16:66: error: 'i' undeclared (first use in this function)
16 | printf("%c %d %c\n", string_s[0], number_total - 2, string_s[i - 1]);
| ^
main.c:16:66: note: each undeclared identifier is reported only once for each function it appears in
|
s060303943 | p03636 | C | /* ex6_1
kosaq */
#include <stdio.h>
#include <string.h>
#define SIZE 101//十分な要素数
int main(void){
char string_s[SIZE];//入力に使う文字列を定義
int number_total;//全文字数を定義
scanf("%s", string_s);//文字列を入力
number_total = strlen(string_s);//全文字数は入力された文字列の長さに等しい
printf("%c%d%c\n", string_s[0], number_total - 2, string_s[i - 1]);
//string_s[0]は先頭の文字を出力、number_total - 2は間の文字数を出力、string_s[i - 1]は最後の文字を出力
return 0;
} | main.c: In function 'main':
main.c:16:64: error: 'i' undeclared (first use in this function)
16 | printf("%c%d%c\n", string_s[0], number_total - 2, string_s[i - 1]);
| ^
main.c:16:64: note: each undeclared identifier is reported only once for each function it appears in
|
s518368141 | p03636 | C++ | #include <stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
cout << s.at(0) << s.length() - 2 << s.at(s.length()) << endl;
} | a.cc:1:10: fatal error: stdc++.h: No such file or directory
1 | #include <stdc++.h>
| ^~~~~~~~~~
compilation terminated.
|
s026248111 | p03636 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int, int>;
int main()
{
string s;
cout << s[0] << s.size() - 2 << s[s.size()-1]
return 0;
} | a.cc: In function 'int main()':
a.cc:11:50: error: expected ';' before 'return'
11 | cout << s[0] << s.size() - 2 << s[s.size()-1]
| ^
| ;
12 | return 0;
| ~~~~~~
|
s271741582 | p03636 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
ch[] ch=sc.next().toCharArray();
int n=ch.length;
System.out.println(ch[0]+(n-2)+ch[n-1]);
}
}
| Main.java:7: error: cannot find symbol
ch[] ch=sc.next().toCharArray();
^
symbol: class ch
location: class Main
1 error
|
s922503545 | p03636 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
int size = s.size();
string first = s[0];
string last = s[size-1];
int number = size-2;
cout <<first+number+last<<endl;
} | a.cc: In function 'int main()':
a.cc:12:21: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
12 | string first = s[0];
| ^
a.cc:13:25: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
13 | string last = s[size-1];
| ^
a.cc:16:15: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
16 | cout <<first+number+last<<endl;
| ~~~~~^~~~~~~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/string:48,
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/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/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:16:16: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
16 | cout <<first+number+last<<endl;
| ^~~~~~
In file included from /usr/include/c++/14/string:54:
/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:16:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: mismatched types 'const _CharT*' and 'int'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: mismatched types 'const _CharT*' and 'int'
16 | cout <<first+number+last<<endl;
| ^~~~~~
/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:16:16: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
16 | cout <<first+number+last<<endl;
| ^~~~~~
|
s243529474 | p03636 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
int size = s.size();
stirng first = s[0];
string last = s[size-1];
int number = size-2;
cout <<first+number+last<<endl;
} | a.cc: In function 'int main()':
a.cc:12:3: error: 'stirng' was not declared in this scope
12 | stirng first = s[0];
| ^~~~~~
a.cc:13:25: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
13 | string last = s[size-1];
| ^
a.cc:16:10: error: 'first' was not declared in this scope
16 | cout <<first+number+last<<endl;
| ^~~~~
|
s353056807 | p03636 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
int sSize = s.size();
cout << s[0] + (sSize - 2) + s[i-1] <<endl;
} | a.cc: In function 'int main()':
a.cc:11:34: error: 'i' was not declared in this scope
11 | cout << s[0] + (sSize - 2) + s[i-1] <<endl;
| ^
|
s579238263 | p03636 | C++ | #include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cctype>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
cout << s[0] << s.size()-2; << s[s.size()-1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:31: error: expected primary-expression before '<<' token
15 | cout << s[0] << s.size()-2; << s[s.size()-1] << endl;
| ^~
|
s456360311 | p03636 | C++ | #include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ll long long
using namespace std;
const ll P = 1000000007;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int main()
{
cout << fixed << setprecision(10);
string S
cin >> S;
int N;
N = S.size()
cout << S[0] << N-2 << S[N-1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:18:3: error: expected initializer before 'cin'
18 | cin >> S;
| ^~~
a.cc:20:7: error: 'S' was not declared in this scope
20 | N = S.size()
| ^
|
s991000274 | p03636 | C | s=input()
print(s[0]+str((len(s)-2))+s[-1]) | main.c:1:1: warning: data definition has no type or storage class
1 | s=input()
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
1 | s=input()
| ^~~~~
main.c:1:3: error: initializer element is not constant
main.c:2:3: error: expected ',' or ';' before 'print'
2 | print(s[0]+str((len(s)-2))+s[-1])
| ^~~~~
|
s926322748 | p03636 | C | s=input()
print(s[0]+str(len(s)-2)+s[-1]) | main.c:1:1: warning: data definition has no type or storage class
1 | s=input()
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
1 | s=input()
| ^~~~~
main.c:1:3: error: initializer element is not constant
main.c:2:1: error: expected ',' or ';' before 'print'
2 | print(s[0]+str(len(s)-2)+s[-1])
| ^~~~~
|
s203388557 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
cout << s.begin() << s.size() -2 << s.end() << endl;
}
| a.cc: In function 'int main()':
a.cc:7:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::__cxx11::basic_string<char>::iterator')
7 | cout << s.begin() << s.size() -2 << s.end() << endl;
| ~~~~ ^~ ~~~~~~~~~
| | |
| | std::__cxx11::basic_string<char>::iterator
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7 |
s365624669 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
// ここにプログラムを追記
string S;
cin>> S;
char a,b;
a = S[0];
b = S[S,size() -1];
int x = S.size();
cout << a << x-2 << b << endl;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: no matching function for call to 'size()'
10 | b = S[S,size() -1];
| ~~~~^~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate expects 1 argument, 0 provided
|
s407976496 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
// ここにプログラムを追記
string S;
cin>> S;
char a,b;
a = S[0];
b = S[S,size()-1];
int x = S.size();
cout << a << x-2 << b << endl;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: no matching function for call to 'size()'
10 | b = S[S,size()-1];
| ~~~~^~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate expects 1 argument, 0 provided
|
s887304172 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
// ここにプログラムを追記
string S;
cin>> S;
char a,b;
a = S[0];
b = S[S,size()-1];
int x = S.size()
cout << a << x-2 << b << endl;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: no matching function for call to 'size()'
10 | b = S[S,size()-1];
| ~~~~^~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate expects 1 argument, 0 provided
a.cc:12:5: error: expected ',' or ';' before 'cout'
12 | cout << a << x-2 << b << endl;
| ^~~~
|
s283717109 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
// ここにプログラムを追記
string S;
cin>> S;
char a,b;
a = S[0];
b = S[S,size()-1];
cout << a << S.size()-2 << b << endl;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: no matching function for call to 'size()'
10 | b = S[S,size()-1];
| ~~~~^~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate expects 1 argument, 0 provided
|
s786101778 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
// ここにプログラムを追記
string S;
cin>> S;
char a,b;
a = S[0]
b = S[S,size()-1]
cout << a << S.size()-2 << b << endl;
} | a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before 'b'
9 | a = S[0]
| ^
| ;
10 | b = S[S,size()-1]
| ~
|
s949599868 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;cin >> S;
cout << S[0] << S.size()-2 << S[S.size-1] << endl;
} | a.cc: In function 'int main()':
a.cc:6:37: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
6 | cout << S[0] << S.size()-2 << S[S.size-1] << endl;
| ~~^~~~
| ()
|
s161143025 | p03636 | Java | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
System.out.println(str.substring(0,1) + str.length()-2 + str.substring(str.length()-1, str.length()));
}
} | Main.java:7: error: bad operand types for binary operator '-'
System.out.println(str.substring(0,1) + str.length()-2 + str.substring(str.length()-1, str.length()));
^
first type: String
second type: int
1 error
|
s414122279 | p03636 | C++ | #include <bits/stdc++.h>
using nanespace std;
int main() {
string s;
cin >> s;
cout << s[0] << s.size() - 2 << s[s.size()] << endl;
} | a.cc:2:7: error: expected nested-name-specifier before 'nanespace'
2 | using nanespace std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> s;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:10: error: 's' was not declared in this scope
6 | cin >> s;
| ^
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout << s[0] << s.size() - 2 << s[s.size()] << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:8:50: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | cout << s[0] << s.size() - 2 << s[s.size()] << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s874778469 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n=s.size();
int m=s.size();
n-=2;
string ans=s[0]+'n'+s[m-1];
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:22: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
9 | string ans=s[0]+'n'+s[m-1];
|
s691358645 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n=s.size();
n-=2;
string ans=s[0]+'n'+s[s.size()-1];
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:22: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
8 | string ans=s[0]+'n'+s[s.size()-1];
|
s488481242 | p03636 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
if(s.size() > 2){
cout << s.at(0) << s.size() - 2 << s.at(s.size()-1) << endl;
}
else cout << s << endl;
} | a.cc: In function 'int main()':
a.cc:6:6: error: 's' was not declared in this scope
6 | if(s.size() > 2){
| ^
|
s216429668 | p03636 | C++ | #include <bis/stdc++.h>
using namespace std;
string n;
int main(void)
{
cin>>n;
cout<<n[0]<<n.size()-2<<n[n.size()-1];
return 0;
} | a.cc:1:10: fatal error: bis/stdc++.h: No such file or directory
1 | #include <bis/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s364570632 | p03636 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string a;
cin>>a;
cout<<a[0]<<a.length-2<<a[a.length-1];
return 0;
} | a.cc: In function 'int main()':
a.cc:7:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
7 | cout<<a[0]<<a.length-2<<a[a.length-1];
| ~~^~~~~~
| ()
a.cc:7:33: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
7 | cout<<a[0]<<a.length-2<<a[a.length-1];
| ~~^~~~~~
| ()
|
s586894249 | p03636 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string a;
cin>>a;
cout<<a[0]<<a.length-2<<s[a.length-1];
return 0;
} | a.cc: In function 'int main()':
a.cc:7:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
7 | cout<<a[0]<<a.length-2<<s[a.length-1];
| ~~^~~~~~
| ()
a.cc:7:29: error: 's' was not declared in this scope
7 | cout<<a[0]<<a.length-2<<s[a.length-1];
| ^
a.cc:7:33: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
7 | cout<<a[0]<<a.length-2<<s[a.length-1];
| ~~^~~~~~
| ()
|
s641299250 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int t = s.size();
cout << s.size(0) << s.size() - 2 << s.size(t) << endl;
}
| a.cc: In function 'int main()':
a.cc:8:17: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int)'
8 | cout << s.size(0) << s.size() - 2 << s.size(t) << endl;
| ~~~~~~^~~
In file included 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,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1076 | size() const _GLIBCXX_NOEXCEPT
| ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate expects 0 arguments, 1 provided
a.cc:8:46: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int&)'
8 | cout << s.size(0) << s.size() - 2 << s.size(t) << endl;
| ~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1076 | size() const _GLIBCXX_NOEXCEPT
| ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate expects 0 arguments, 1 provided
|
s288059781 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int t = s.size()
cout << s.size(0) << s.size() - 2 << s.size(t);
}
| a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'cout'
8 | cout << s.size(0) << s.size() - 2 << s.size(t);
| ^~~~
|
s558461615 | p03636 | C++ | using namespace std;
int main() {
string s;
cin >> s;
size_t size = str.length();
size = size - 2
cout << s[0] + size + s[size_t] << endl;
} | a.cc:6:3: error: extended character is not valid in an identifier
6 | size_t size = str.length();
| ^
a.cc: In function 'int main()':
a.cc:4:5: error: 'string' was not declared in this scope
4 | string s;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | using namespace std;
a.cc:5:5: error: 'cin' was not declared in this scope
5 | cin >> s;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:5:12: error: 's' was not declared in this scope
5 | cin >> s;
| ^
a.cc:6:3: error: '\U00003000size_t' was not declared in this scope
6 | size_t size = str.length();
| ^~~~~~~~
a.cc:7:5: error: 'size' was not declared in this scope
7 | size = size - 2
| ^~~~
|
s081049478 | p03636 | C++ | internationalization | a.cc:1:1: error: 'internationalization' does not name a type
1 | internationalization
| ^~~~~~~~~~~~~~~~~~~~
|
s700618772 | p03636 | Java | import java.util.*;
class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String s = sc.nextInt();
int sLength = s.length();
String s1 = s.substring(0, 1);
String s2 = s.substring(sLength - 1, sLength);
String num = String.valueOf(sLength - 2);
String ans = s1 + num + s2;
System.out.println(ans);
}
} | Main.java:9: error: incompatible types: int cannot be converted to String
String s = sc.nextInt();
^
1 error
|
s627270545 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int n=s.size()
cout<<s.at(0)<<"n-2"<<s.at(n-1)<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'cout'
8 | cout<<s.at(0)<<"n-2"<<s.at(n-1)<<endl;
| ^~~~
|
s643011675 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int n=s.size()
cout<<s.at(0)<<n-2<<s.at(n-1)<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'cout'
8 | cout<<s.at(0)<<n-2<<s.at(n-1)<<endl;
| ^~~~
|
s333539050 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int n=s.size()
cout<<s.at(0)<<n-1<<s.at(n)<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'cout'
8 | cout<<s.at(0)<<n-1<<s.at(n)<<endl;
| ^~~~
|
s872207232 | p03636 | C | #include<stdio.h>
#include<string.h>
int main(void)
{
char s[100];
scanf("%s",s);
int n=(strlen(a))-2;
printf("%c%d%c",a[0],n,a[n+1]);
return 0;
} | main.c: In function 'main':
main.c:10:19: error: 'a' undeclared (first use in this function)
10 | int n=(strlen(a))-2;
| ^
main.c:10:19: note: each undeclared identifier is reported only once for each function it appears in
|
s639811318 | p03636 | Java | import java.util.*;
public class Main{
public static void main(Stinrg[] args){
Scanner sc = new Scanner(System.in);
String S = sc.next();
int len = S.lenght()-2;
char s1 = S.charAt(0);
char s2 = S.charAt(S.length()-1);
System.out,println(s1+len+s2);
}
}
| Main.java:10: error: not a statement
System.out,println(s1+len+s2);
^
Main.java:10: error: ';' expected
System.out,println(s1+len+s2);
^
2 errors
|
s096100569 | p03636 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
int n=S.size();
string x=stoi(n-2);
cout<<S.at(0)+x+S.at(n-1)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:16: error: no matching function for call to 'stoi(int)'
7 | string x=stoi(n-2);
| ~~~~^~~~~
In file included 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,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10)
| ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note: no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10)
| ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
4432 | stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
| ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note: no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
4432 | stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
| ~~~~~~~~~~~~~~~^~~~~
|
s851937025 | p03636 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s, kari;
int count;
cin >> s;
count = s.size();
kari = s[s.size() - 1];
s[2] = kari;
cout << s[0] << s.size()-2 << s[2] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:10: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
11 | s[2] = kari;
| ^~~~
| |
| std::string {aka std::__cxx11::basic_string<char>}
|
s705448839 | p03636 | C++ | #include<iostream>
#include<cstring>
using namespace std;
char s[10005];
int main()
{
gets(s);
cout << s[0] << strlen(s)-2 << s[strlen(s)-1];
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(s);
| ^~~~
| getw
|
s343832422 | p03636 | C++ | #include<iostream>
using namespace std;
char s[10005];
int main()
{
gets(s);
cout << s[0] << strlen(s)-2 << s[strlen(s)-1];
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | gets(s);
| ^~~~
| getw
a.cc:7:21: error: 'strlen' was not declared in this scope
7 | cout << s[0] << strlen(s)-2 << s[strlen(s)-1];
| ^~~~~~
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 | using namespace std;
|
s558571983 | p03636 | C++ | S=input()
print(S[:1]+str(len(S)-2)+S[-1:]) | a.cc:1:1: error: 'S' does not name a type
1 | S=input()
| ^
|
s293386420 | p03636 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int x = s.at();
cout << s.at(0) << x - 2 << s.at(x - 1) << endl;
}
| a.cc: In function 'int main()':
a.cc:8:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::at()'
8 | int x = s.at();
| ~~~~^~
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/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
1287 | at(size_type __n) const
| ^~
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
1309 | at(size_type __n)
| ^~
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate expects 1 argument, 0 provided
|
s893472243 | p03636 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int x = s.at();
cout << s.at(0) << x - 2 << s.at(x - 1) << endl;
}
| a.cc: In function 'int main()':
a.cc:8:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::at()'
8 | int x = s.at();
| ~~~~^~
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/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
1287 | at(size_type __n) const
| ^~
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
1309 | at(size_type __n)
| ^~
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate expects 1 argument, 0 provided
|
s379278730 | p03636 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int x = s.at();
cout << s[0] << N - 2 << s[N - 1] << endl;
}
| a.cc: In function 'int main()':
a.cc:8:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::at()'
8 | int x = s.at();
| ~~~~^~
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/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
1287 | at(size_type __n) const
| ^~
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
1309 | at(size_type __n)
| ^~
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate expects 1 argument, 0 provided
a.cc:9:25: error: 'N' was not declared in this scope
9 | cout << s[0] << N - 2 << s[N - 1] << endl;
| ^
|
s385870921 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
int x;
a.at() = 'x';
cout << a.at(0) << x << a.at(x) << endl;
}
| a.cc: In function 'int main()':
a.cc:8:7: error: no matching function for call to 'std::__cxx11::basic_string<char>::at()'
8 | a.at() = 'x';
| ~~~~^~
In file included 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,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
1287 | at(size_type __n) const
| ^~
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
1309 | at(size_type __n)
| ^~
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate expects 1 argument, 0 provided
|
s146643344 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
int x = a.at();
cout << a.at(0) << x << a.at(x) << endl;
}
| a.cc: In function 'int main()':
a.cc:7:15: error: no matching function for call to 'std::__cxx11::basic_string<char>::at()'
7 | int x = a.at();
| ~~~~^~
In file included 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,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
1287 | at(size_type __n) const
| ^~
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
1309 | at(size_type __n)
| ^~
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate expects 1 argument, 0 provided
|
s698103180 | p03636 | C++ | #include <bit/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int N=s.length();
cout << s[0] << N-2 << s[N-1] << endl;
}
| a.cc:1:10: fatal error: bit/stdc++.h: No such file or directory
1 | #include <bit/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s517666857 | p03636 | C++ | #include <bit/stdc++>
using namespace std;
int main(){
string s;
cin >> s;
int N=s.length();
cout << s[0] << N-2 << s[N-1] << endl;
} | a.cc:1:10: fatal error: bit/stdc++: No such file or directory
1 | #include <bit/stdc++>
| ^~~~~~~~~~~~
compilation terminated.
|
s814640584 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n = s.size;
cout << s.at(0) << n - 2 << s.at(n) << endl;
}
| a.cc: In function 'int main()':
a.cc:7:13: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
7 | int n = s.size;
| ^~~~
|
s293033798 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n;
n = s.size;
cout << s.at(0) << n - 2 << s.at(n) << endl;
}
| a.cc: In function 'int main()':
a.cc:8:9: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
8 | n = s.size;
| ^~~~
|
s132757159 | p03636 | C++ | #include<iostream>
#include<cstring>
#include<string>
using namespace std;
const int maxn=1e6+1;
char s[maxn];
int main(){
gets(s);
cout<<s[0]<<strlen(s)-2<<s[strlen(s)-1]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(s);
| ^~~~
| getw
|
s057206924 | p03636 | C++ | s = input()
print(s[0] + str(len(s)-2) + s[len(s)-1]) | a.cc:1:1: error: 's' does not name a type
1 | s = input()
| ^
|
s587346604 | p03636 | C++ | #include <iostream>
using namespace std;
int main(){
string s;
cin >> s ;
cout << s.at(0) << .size(s) << s.at(.size(s)) << endl;
} | a.cc: In function 'int main()':
a.cc:8:22: error: expected primary-expression before '.' token
8 | cout << s.at(0) << .size(s) << s.at(.size(s)) << endl;
| ^
a.cc:8:39: error: expected primary-expression before '.' token
8 | cout << s.at(0) << .size(s) << s.at(.size(s)) << endl;
| ^
|
s404843804 | p03636 | C++ | a=input()
b=a[0]+str(len(a)-2)+a[-1]
print(b) | a.cc:1:1: error: 'a' does not name a type
1 | a=input()
| ^
|
s282521112 | p03636 | C++ | #include<iostream>
#include<string>
int main(){
string s;
int num=0;
for(int i=1;i<s.size()-1;i++){
num++;
}
cout << s.at(0) << num << s.at(s.size()-1) << endl; | a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:5:3: 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:7:17: error: 's' was not declared in this scope
7 | for(int i=1;i<s.size()-1;i++){
| ^
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | cout << s.at(0) << num << s.at(s.size()-1) << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:11:11: error: 's' was not declared in this scope
11 | cout << s.at(0) << num << s.at(s.size()-1) << endl;
| ^
a.cc:11:49: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | cout << s.at(0) << num << s.at(s.size()-1) << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:11:54: error: expected '}' at end of input
11 | cout << s.at(0) << num << s.at(s.size()-1) << endl;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s439651212 | p03636 | C++ | #include<iostream>
#include<cstring>
using namespace std;
int main(){
int a[110];
cin>>a;
int s=0;
for(int i=0;i<strlen(a);i++){
if(i==0)cout<<a[i];
else
if(i==strlen(a)-1)cout<<s<<a[i];
else
s++;
}
} | a.cc: In function 'int main()':
a.cc:6:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [110]')
6 | cin>>a;
| ~~~^~~
| | |
| | int [110]
| std::istream {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:6:14: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
6 | cin>>a;
| ^
/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:6:14: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
6 | cin>>a;
| ^
| |
| int*
a.cc:6:14: error: cannot bind rvalue '(short int)((int*)(& a))' 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:6:14: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
6 | cin>>a;
| ^
| |
| int*
a.cc:6:14: error: cannot bind rvalue '(short unsigned int)((int*)(& a))' 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:6:14: error: invalid conversion from 'int*' to 'int' [-fpermissive]
6 | cin>>a;
| ^
| |
| int*
a.cc:6:14: error: cannot bind rvalue '(int)((int*)(& a))' 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:6:14: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
6 | cin>>a;
| ^
| |
| int*
a.cc:6:14: error: cannot bind rvalue '(unsigned int)((int*)(& a))' 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:6:14: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
6 | cin>>a;
| ^
| |
| int*
a.cc:6:14: error: cannot bind rvalue '(long int)((int*)(& a))' 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:6:14: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
6 | cin>>a;
| ^
| |
| int*
a.cc:6:14: error: cannot bind rvalue '(long unsigned int)((int*)(& a))' 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:6:14: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
6 | cin>>a;
| ^
| |
| int*
a.cc:6:14: error: cannot bind rvalue '(long long int)((int*)(& a))' 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:6:14: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
6 | cin>>a;
| ^
| |
| int*
a.cc:6:14: error: cannot bind rvalue '(long long unsigned int)((int*)(& a))' 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:6:14: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
6 | cin>>a;
| ^
/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 'int [110]' 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 'int [110]' 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 'int [110]' 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 'int [110]' 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::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [110]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT |
s381029046 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
string s;
scanf("%s",s);
printf("%c",s[0]);
printf("%d",s.size-2);
printf("%c",s[100]);
} | a.cc: In function 'int main()':
a.cc:7:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
7 | printf("%d",s.size-2);
| ~~^~~~
| ()
|
s647023629 | p03636 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
string s;
scanf("%s",s);
printf("%c",s[0]);
printf("%d",s.length-2);
printf("%c",s[100]);
}
| a.cc: In function 'int main()':
a.cc:7:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
7 | printf("%d",s.length-2);
| ~~^~~~~~
| ()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.