Advertisement
RicoHeartless

Laboratorie 2

Mar 20th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. //TASK 1
  2. #include <stdio.h>
  3. int main()
  4. {
  5.     char O[] = "OOOOOOOO";
  6.     printf("%s", O);
  7.     printf("\nO  OO  O\nO O  O O\nOO    OO\nOO    OO\nO O  O O\nO  OO  O \n%s", O);
  8.     getchar();
  9.     return 0;
  10. }
  11. //TASK 2
  12. #include <stdio.h>
  13. int main()
  14. {
  15.     int a = 0177176;
  16.     unsigned long b = 9613;
  17.     char c[] = "abcdef";
  18.     long d = 0xffffabdf;   
  19.     printf("\ta=%+-*.7u\tb=%+-*.01x c=%.4s d=%-*.8li", 12, a, 10, b, c, 16, d);
  20.     getchar();
  21.     return 0;
  22. }
  23. //TASK 3
  24. #include <stdio.h>
  25. #include <windows.h>
  26. int main()
  27. {
  28.     double a;
  29.     char b;
  30.     long double c;
  31.     unsigned long d;
  32.     scanf_s("%131E;%c;%10Lf %6lu", &a, &b, &c, &d);
  33.     printf("a=%E\nb=%c\nc=%Lf\nd=%lu\n",a, b, c, d);
  34.     system("pause"); //Input Data: 4.182632E+01;*;12.836329 256893
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement