Main.cc: In function ‘int main()’: Main.cc:28:9: error: ‘swap’ was not declared in this scope if(k>m)swap(k,m); ^~~~ Main.cc:28:9: note: suggested alternatives: In file included from /usr/include/c++/7/complex:45:0, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from Main.cc:1: /usr/include/c++/7/sstream:796:5: note: ‘std::__cxx11::swap’ swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x, ^~~~ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from Main.cc:1: /usr/include/c++/7/bits/regex.h:2000:5: note: ‘std::__cxx11::swap’ swap(match_results<_Bi_iter, _Alloc>& __lhs, ^~~~ In file included from /usr/include/c++/7/exception:142:0, from /usr/include/c++/7/ios:39, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from Main.cc:1: /usr/include/c++/7/bits/exception_ptr.h:166:5: note: ‘std::__exception_ptr::swap’ swap(exception_ptr& __lhs, exception_ptr& __rhs) ^~~~ In file included from /usr/include/c++/7/bits/nested_exception.h:40:0, from /usr/include/c++/7/exception:143, from /usr/include/c++/7/ios:39, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from Main.cc:1: /usr/include/c++/7/bits/move.h:187:5: note: ‘std::swap’ swap(_Tp& __a, _Tp& __b) ^~~~ Main.cc:27:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d,%d",&k,&m); ~~~~~^~~~~~~~~~~~~~~