fork download
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <vector>
  5. #include <unordered_map>
  6. #include <string.h>
  7. using namespace std;
  8. unordered_map<string,vector<unsigned int>> mapping[4][5];
  9. vector<string> ngramset;
  10. int space[5];
  11. int theanswer[5];
  12. unsigned int frequency[5];
  13. int answers=0;
  14. void therecordinganswerprocess(int posting,char splitword[5][200]){
  15. if(posting!=-1){
  16. unsigned int thefrequency=0;
  17. int stringlength=ngramset[posting].length();
  18. for(int i=0;;i++){
  19. if(ngramset[posting][stringlength-i-1]>='0'&&ngramset[posting][stringlength-i-1]<='9'){
  20. unsigned int toplus=0;
  21. toplus+=ngramset[posting][stringlength-i-1]-'0';
  22. for(unsigned int j=0;j<i;j++){
  23. toplus*=10;
  24. }
  25. thefrequency+=toplus;
  26. }
  27. else{
  28. break;
  29. }
  30. }
  31. for(int i=0;i<=4;i++){
  32. if(thefrequency>frequency[i]){
  33. for(int j=4;j>i;j--){
  34. theanswer[j]=theanswer[j-1];
  35. frequency[j]=frequency[j-1];
  36. }
  37. theanswer[i]=posting;
  38. frequency[i]=thefrequency;
  39. break;
  40. }
  41. else if(thefrequency==frequency[i]){
  42. char temp[50]={};
  43. for(int j=0;ngramset[theanswer[i]][j]!=' ';j++){
  44. temp[j]=ngramset[theanswer[i]][j];
  45. }
  46. if(strcmp(splitword[0],temp)>0){
  47. for(int j=4;j>i;j--){
  48. theanswer[j]=theanswer[j-1];
  49. frequency[j]=frequency[j-1];
  50. }
  51. theanswer[i]=posting;
  52. frequency[i]=thefrequency;
  53. break;
  54. }
  55. }
  56. }
  57. if(answers<5)
  58. answers++;
  59. }
  60. else{
  61. ;
  62. }
  63. }
  64. void themergingprocess(char splitword[5][200],int index,int wordnumber,int posting){
  65. if(wordnumber>=1){
  66. if(index>wordnumber){
  67. therecordinganswerprocess(posting,splitword);
  68. }
  69. else if(space[index]==1){
  70. themergingprocess(splitword,index+1,wordnumber,posting);
  71. }
  72. else if(posting==-1){
  73. unordered_map<string,vector<unsigned int>>::iterator iter;
  74. iter=mapping[wordnumber-1][index].find(splitword[index]);
  75. if(iter!=mapping[wordnumber-1][index].end()){
  76. int postingsize=(iter->second).size();
  77. for(int i=0;i<postingsize;i++){
  78. themergingprocess(splitword,index+1,wordnumber,(iter->second)[i]);
  79. }
  80. }
  81. }
  82. else{
  83. unordered_map<string,vector<unsigned int>>::iterator iter;
  84. iter=mapping[wordnumber-1][index].find(splitword[index]);
  85. if(iter!=mapping[wordnumber-1][index].end()){
  86. int postingsize=(iter->second).size();
  87. for(int i=0;i<postingsize;i++){
  88. if((iter->second)[i]==posting){
  89. themergingprocess(splitword,index+1,wordnumber,posting);
  90. }
  91. }
  92. }
  93. }
  94. }
  95. }
  96. void theexpansionprocess(char splitword[5][200],int index,int wordnumber){
  97. if(index<=wordnumber){
  98. if(splitword[index][0]=='?'){
  99. for(int i=0;i<=48;i++){
  100. splitword[index][i]=splitword[index][i+1];
  101. }
  102. splitword[index][49]='\0';
  103. theexpansionprocess(splitword,index,wordnumber);
  104. for(int i=index;i<=3;i++){
  105. strcpy(splitword[i],splitword[i+1]);
  106. }
  107. theexpansionprocess(splitword,index,wordnumber-1);
  108. }
  109. else{
  110. int check=0;
  111. for(int i=0;i<=49;i++){
  112. if(splitword[index][i]=='/'){
  113. char temp[50]={};
  114. splitword[index][i]='\0';
  115. for(int j=i+1;j<=49;j++){
  116. temp[j-i-1]=splitword[index][j];
  117. splitword[index][j]='\0';
  118. }
  119. theexpansionprocess(splitword,index,wordnumber);
  120. strcpy(splitword[index],temp);
  121. theexpansionprocess(splitword,index,wordnumber);
  122. check=1;
  123. break;
  124. }
  125. }
  126. if(check==0){
  127. if(splitword[index][0]=='_'){
  128. check=1;
  129. space[index]=1;
  130. theexpansionprocess(splitword,index+1,wordnumber);
  131. }
  132. else if(splitword[index][0]=='*'){
  133. check=1;
  134. for(int i=index;i<=3;i++){
  135. strcpy(splitword[i],splitword[i+1]);
  136. }
  137. theexpansionprocess(splitword,index,wordnumber-1);
  138. for(int i=0;i<=4-wordnumber;i++){
  139. for(int j=index;j<=4;j++){
  140. strcpy(splitword[j+1],splitword[j]);
  141. }
  142. space[index+i]=1;
  143. theexpansionprocess(splitword,index+i+1,wordnumber+i);
  144. }
  145. }
  146. }
  147. if(check==0)
  148. theexpansionprocess(splitword,index+1,wordnumber);
  149. }
  150. }
  151. else{
  152. themergingprocess(splitword,0,wordnumber,-1);
  153. }
  154. }
  155. int main(int argc,char *argv[])
  156. {
  157. FILE *twogram,*threegram,*fourgram,*fivegram;
  158. twogram = fopen((string(argv[1]) + "2gm.small.txt").c_str(), "r");
  159. threegram = fopen((string(argv[1]) + "3gm.small.txt").c_str(), "r");
  160. fourgram = fopen((string(argv[1]) + "4gm.small.txt").c_str(), "r");
  161. fivegram = fopen((string(argv[1]) + "5gm.small.txt").c_str(), "r");
  162. int posting=-1;
  163. while(1){
  164. unordered_map<string,vector<unsigned int>>::iterator iter;
  165. char tempchar[6][50]=undefined;
  166. unsigned int tempnumber;
  167. if(fscanf(twogram,"%s%s%s",tempchar[0],tempchar[1],tempchar[2])==3){
  168. posting++;
  169. for(int i=0;i<=1;i++){
  170. string tempstring=tempchar[i];
  171. iter=mapping[0][i].find(tempstring);
  172. if(iter==mapping[0][i].end()){
  173. vector<unsigned int> tempvector;
  174. mapping[0][i][tempstring]=tempvector;
  175. iter=mapping[0][i].find(tempstring);
  176. (iter->second).push_back(posting);
  177. }
  178. else{
  179. (iter->second).push_back(posting);
  180. }
  181. }
  182. string anothertemp=string(tempchar[0])+" "+string(tempchar[1])+" "+string(tempchar[2]);
  183. ngramset.push_back(anothertemp);
  184. }
  185. else{
  186. break;
  187. }
  188. }
  189. while(1){
  190. unordered_map<string,vector<unsigned int>>::iterator iter;
  191. char tempchar[6][50]=undefined;
  192. unsigned int tempnumber;
  193. if(fscanf(threegram,"%s%s%s%s",tempchar[0],tempchar[1],tempchar[2],tempchar[3])==4){
  194. posting++;
  195. for(int i=0;i<=2;i++){
  196. string tempstring=tempchar[i];
  197. iter=mapping[1][i].find(tempstring);
  198. if(iter==mapping[1][i].end()){
  199. vector<unsigned int> tempvector;
  200. mapping[1][i][tempstring]=tempvector;
  201. iter=mapping[1][i].find(tempstring);
  202. (iter->second).push_back(posting);
  203. }
  204. else{
  205. (iter->second).push_back(posting);
  206. }
  207. }
  208. string anothertemp=string(tempchar[0])+" "+string(tempchar[1])+" "+string(tempchar[2])+" "+string(tempchar[3]);
  209. ngramset.push_back(anothertemp);
  210. }
  211. else{
  212. break;
  213. }
  214. }
  215. while(1){
  216. unordered_map<string,vector<unsigned int>>::iterator iter;
  217. char tempchar[6][50]=undefined;
  218. unsigned int tempnumber;
  219. if(fscanf(fourgram,"%s%s%s%s%s",tempchar[0],tempchar[1],tempchar[2],tempchar[3],tempchar[4])==5){
  220. posting++;
  221. for(int i=0;i<=3;i++){
  222. string tempstring=tempchar[i];
  223. iter=mapping[2][i].find(tempstring);
  224. if(iter==mapping[2][i].end()){
  225. vector<unsigned int> tempvector;
  226. mapping[2][i][tempstring]=tempvector;
  227. iter=mapping[2][i].find(tempstring);
  228. (iter->second).push_back(posting);
  229. }
  230. else{
  231. (iter->second).push_back(posting);
  232. }
  233. }
  234. string anothertemp=string(tempchar[0])+" "+string(tempchar[1])+" "+string(tempchar[2])+" "+string(tempchar[3])+" "+string(tempchar[4]);
  235. ngramset.push_back(anothertemp);
  236. }
  237. else{
  238. break;
  239. }
  240. }
  241. while(1){
  242. unordered_map<string,vector<unsigned int>>::iterator iter;
  243. char tempchar[6][50]=undefined;
  244. unsigned int tempnumber;
  245. if(fscanf(fivegram,"%s%s%s%s%s%s",tempchar[0],tempchar[1],tempchar[2],tempchar[3],tempchar[4],tempchar[5])==6){
  246. posting++;
  247. for(int i=0;i<=4;i++){
  248. string tempstring=tempchar[i];
  249. iter=mapping[3][i].find(tempstring);
  250. if(iter==mapping[3][i].end()){
  251. vector<unsigned int> tempvector;
  252. mapping[3][i][tempstring]=tempvector;
  253. iter=mapping[3][i].find(tempstring);
  254. (iter->second).push_back(posting);
  255. }
  256. else{
  257. (iter->second).push_back(posting);
  258. }
  259. }
  260. string anothertemp=string(tempchar[0])+" "+string(tempchar[1])+" "+string(tempchar[2])+" "+string(tempchar[3])+" "+string(tempchar[4])+" "+string(tempchar[5]);
  261. ngramset.push_back(anothertemp);
  262. }
  263. else{
  264. break;
  265. }
  266. }
  267. while(1){
  268. char query[1000]={};
  269. if(cin.getline(query,1000)!=0){
  270. cout<<"query: "<<query<<"\n";
  271. char splitword[5][200]=undefined;
  272. int stringlength=strlen(query);
  273. int arrayindex=0,wordindex=0;
  274. for(int i=0;i<stringlength;i++,wordindex++){
  275. if(query[i]==' '){
  276. arrayindex++;
  277. wordindex=-1;
  278. }
  279. else{
  280. splitword[arrayindex][wordindex]=query[i];
  281. }
  282. }
  283. for(int i=0;i<=4;i++){
  284. space[i]=0;
  285. theanswer[i]=-1;
  286. frequency[i]=0;
  287. }
  288. answers=0;
  289. theexpansionprocess(splitword,0,arrayindex);
  290. cout<<"output: "<<answers<<"\n";
  291. for(int i=0;i<answers;i++){
  292. cout<<ngramset[theanswer[i]]<<"\n";
  293. }
  294. }
  295. else{
  296. break;
  297. }
  298. }
  299.  
  300. return 0;
  301. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:165:30: error: ‘undefined’ was not declared in this scope
         char tempchar[6][50]=undefined;
                              ^~~~~~~~~
prog.cpp:191:30: error: ‘undefined’ was not declared in this scope
         char tempchar[6][50]=undefined;
                              ^~~~~~~~~
prog.cpp:217:30: error: ‘undefined’ was not declared in this scope
         char tempchar[6][50]=undefined;
                              ^~~~~~~~~
prog.cpp:243:30: error: ‘undefined’ was not declared in this scope
         char tempchar[6][50]=undefined;
                              ^~~~~~~~~
prog.cpp:269:35: error: no match for ‘operator!=’ (operand types are ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ and ‘int’)
         if(cin.getline(query,1000)!=0){
            ~~~~~~~~~~~~~~~~~~~~~~~^~~
prog.cpp:269:35: note: candidate: operator!=(int, int) <built-in>
prog.cpp:269:35: 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++/6/iosfwd:40:0,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/postypes.h:221:5: note: candidate: template<class _StateT> bool std::operator!=(const std::fpos<_StateT>&, const std::fpos<_StateT>&)
     operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
     ^~~~~~~~
/usr/include/c++/6/bits/postypes.h:221:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::fpos<_StateT>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_pair.h:444:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator!=(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:444:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::pair<_T1, _T2>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:304:5: note: candidate: template<class _Iterator> bool std::operator!=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator!=(const reverse_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:304:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:361:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator!=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator!=(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:361:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1125:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator!=(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator!=(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1125:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::move_iterator<_IteratorL>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1131:5: note: candidate: template<class _Iterator> bool std::operator!=(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
     operator!=(const move_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1131:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::move_iterator<_IteratorL>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/string:41:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/allocator.h:158:5: note: candidate: template<class _T1, class _T2> bool std::operator!=(const std::allocator<_CharT>&, const std::allocator<_T2>&)
     operator!=(const allocator<_T1>&, const allocator<_T2>&)
     ^~~~~~~~
/usr/include/c++/6/bits/allocator.h:158:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::allocator<_CharT>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/string:41:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/allocator.h:164:5: note: candidate: template<class _Tp> bool std::operator!=(const std::allocator<_CharT>&, const std::allocator<_CharT>&)
     operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
     ^~~~~~~~
/usr/include/c++/6/bits/allocator.h:164:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::allocator<_CharT>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5112:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5112:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5125:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator!=(const _CharT* __lhs,
     ^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5125:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   mismatched types ‘const _CharT*’ and ‘std::basic_istream<char>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5137:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5137:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/bits/ios_base.h:46:0,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/system_error:311:3: note: candidate: bool std::operator!=(const std::error_code&, const std::error_code&)
   operator!=(const error_code& __lhs, const error_code& __rhs) noexcept
   ^~~~~~~~
/usr/include/c++/6/system_error:311:3: note:   no known conversion for argument 1 from ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ to ‘const std::error_code&’
/usr/include/c++/6/system_error:315:3: note: candidate: bool std::operator!=(const std::error_code&, const std::error_condition&)
   operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept
   ^~~~~~~~
/usr/include/c++/6/system_error:315:3: note:   no known conversion for argument 1 from ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ to ‘const std::error_code&’
/usr/include/c++/6/system_error:319:3: note: candidate: bool std::operator!=(const std::error_condition&, const std::error_code&)
   operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept
   ^~~~~~~~
/usr/include/c++/6/system_error:319:3: note:   no known conversion for argument 1 from ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ to ‘const std::error_condition&’
/usr/include/c++/6/system_error:323:3: note: candidate: bool std::operator!=(const std::error_condition&, const std::error_condition&)
   operator!=(const error_condition& __lhs,
   ^~~~~~~~
/usr/include/c++/6/system_error:323:3: note:   no known conversion for argument 1 from ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ to ‘const std::error_condition&’
In file included from /usr/include/c++/6/bits/locale_facets.h:48:0,
                 from /usr/include/c++/6/bits/basic_ios.h:37,
                 from /usr/include/c++/6/ios:44,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/streambuf_iterator.h:210:5: note: candidate: template<class _CharT, class _Traits> bool std::operator!=(const std::istreambuf_iterator<_CharT, _Traits>&, const std::istreambuf_iterator<_CharT, _Traits>&)
     operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
     ^~~~~~~~
/usr/include/c++/6/bits/streambuf_iterator.h:210:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::istreambuf_iterator<_CharT, _Traits>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/vector:64:0,
                 from prog.cpp:4:
/usr/include/c++/6/bits/stl_vector.h:1533:5: note: candidate: template<class _Tp, class _Alloc> bool std::operator!=(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)
     operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
     ^~~~~~~~
/usr/include/c++/6/bits/stl_vector.h:1533:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::vector<_Tp, _Alloc>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/tuple:39:0,
                 from /usr/include/c++/6/unordered_map:41,
                 from prog.cpp:5:
/usr/include/c++/6/array:246:5: note: candidate: template<class _Tp, long unsigned int _Nm> bool std::operator!=(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)
     operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
     ^~~~~~~~
/usr/include/c++/6/array:246:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::array<_Tp, _Nm>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/unordered_map:41:0,
                 from prog.cpp:5:
/usr/include/c++/6/tuple:1367:5: note: candidate: template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const std::tuple<_Elements ...>&, const std::tuple<_Elements ...>&)
     operator!=(const tuple<_TElements...>& __t,
     ^~~~~~~~
/usr/include/c++/6/tuple:1367:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::tuple<_Elements ...>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/unordered_map:48:0,
                 from prog.cpp:5:
/usr/include/c++/6/bits/unordered_map.h:1774:5: note: candidate: template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> bool std::operator!=(const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&, const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&)
     operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/unordered_map.h:1774:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>’
         if(cin.getline(query,1000)!=0){
                                     ^
In file included from /usr/include/c++/6/unordered_map:48:0,
                 from prog.cpp:5:
/usr/include/c++/6/bits/unordered_map.h:1786:5: note: candidate: template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> bool std::operator!=(const std::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&, const std::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&)
     operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/unordered_map.h:1786:5: note:   template argument deduction/substitution failed:
prog.cpp:269:37: note:   ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ is not derived from ‘const std::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>’
         if(cin.getline(query,1000)!=0){
                                     ^
prog.cpp:271:36: error: ‘undefined’ was not declared in this scope
             char splitword[5][200]=undefined;
                                    ^~~~~~~~~
stdout
Standard output is empty