fork(1) download
  1. #include <iostream.h>
  2. #include <conio.h>
  3. #include <ctype.h>
  4. #include <string.h>
  5.  
  6. //Function 1
  7. void upgrade(int &acr)
  8. { acr=9; cout<<"\n\n>Successfully updated the file."; getch(); }
  9.  
  10.  
  11. //Function 2
  12. void search(char ch[160],char acronym[9][36],int acr)
  13. { int count,c=strlen(ch);
  14. for(int i=0;i<acr;i++)
  15. {
  16. for(int j=0;acronym[i][j]!='=';j++);
  17. for(int k=0;k<=c;k++)
  18. { for(int l=0,count=0;l<j;l++)
  19. if(toupper(ch[k+l])==acronym[i][l]) count++;
  20. if(count==j) {cout<<'\n'<<acronym[i]; break;}
  21. }
  22. }
  23. }
  24.  
  25.  
  26. //Function 3
  27. void display (char ch[160], char acronym[9][36],int acr)
  28. { int i,j,k,l,count,p;
  29. for(i=0;i<=strlen(ch);i++)
  30. { for(j=0;j<acr;j++)
  31. { for(l=0;acronym[j][l]!='=';l++);
  32. for(k=0,count=0,p=0;k<l;k++)
  33. if(toupper(ch[i+k])==acronym[j][k]) count++;
  34. if(count==l) {i+=l-1; for(l+=1;acronym[j][l]!='\0';l++) cout<<acronym[j][l]; p=1; break;}
  35. }
  36. if(p==0)
  37. cout<<ch[i];
  38. }
  39. }
  40.  
  41.  
  42.  
  43. // Function main()
  44. void main()
  45. {
  46. clrscr();
  47. int acr=2, c;
  48. char ch[160], acronym[9][36]={"LOL=laughing out loud",
  49. "IRL=in real life",
  50. "AFK=away from keyboard",
  51. "BFF=best friends forever",
  52. "FWT=for the victory",
  53. "IIRC=if I recall correctly",
  54. "IMHO=in my humble opinion",
  55. "NVM=never mind",
  56. "TTYL=talk to you later"};
  57. cout<<">Press \"u\" if you want to upgrade the program's acromyms' list. ";
  58. c=getch();
  59. if(c==85||c==117) upgrade(acr);
  60. clrscr();
  61. cout<<">Enter your tweet(max. 160 characters): "; cin.getline(ch,160);
  62. search(ch,acronym,acr);
  63. cout<<"\n\n>Converting user's tweet......\n\n";
  64. display(ch,acronym,acr);
  65. getch();
  66. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:22: fatal error: iostream.h: No such file or directory
compilation terminated.
stdout
Standard output is empty