Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #include <locale.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <Windows.h>
  5.  
  6. void inputString(char* name) {
  7. printf("Enter your string: ");
  8. fgets(name, 100, stdin);
  9. }
  10.  
  11. void changeString(name) {
  12. printf("The result of program is: ");
  13. char* newName = name;
  14. char c = 0;
  15. while (c = *newName++)
  16. {
  17. if (c == 'a' || c == 'а')
  18. {
  19. *(newName - 1 )= '@';
  20. }
  21. }
  22. }
  23.  
  24. void outputString(name) {
  25. printf("The result of program is: ");
  26. char* newName = name;
  27. char c = 0;
  28. while (c = *newName++)
  29. {
  30. printf("%c", c);
  31. Sleep(200);
  32. }
  33. }
  34. void outputString1(name) {
  35. printf("The result of program is: ");
  36. char* newName = name;
  37. char c = 0;
  38. while (c = *newName++)
  39. {
  40.  
  41. if (c == 'a' || c == 'а')
  42. {
  43. c = '@';
  44. printf("%c", c);
  45. }
  46. else {
  47. printf("%c", c);
  48. }
  49. Sleep(200);
  50. }
  51. }
  52.  
  53. int main()
  54. {
  55. char name[100];
  56. inputString(&name);
  57. changeString(name);
  58. outputString(name);
  59. return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement