Pushok

Writing text with sinusoid style

Apr 18th, 2011
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include "stdio.h"
  2. #include "stdlib.h"
  3. #include "conio.h"
  4. #include "cmath"
  5. #include "windows.h"
  6.  
  7. void gotoxy(int x, int y)
  8. {
  9.     COORD crd = {x,y};
  10.     SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), crd);
  11. }
  12.  
  13. int main()
  14. {
  15.     char* s = "I like C++ very much!";
  16.     for(double i=0, mi = 30;i<(double)strlen(s);i++)
  17.     {
  18.         gotoxy(i*3, -sin(i)*2 + mi);
  19.         putc(s[int(i)], stdout);
  20.     }
  21.     getch();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment