Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 8.71 KB | None | 0 0
  1. /////////////////////////////////////////
  2. ////Задания
  3. //#include "windows.h"
  4. //#include <iostream>
  5. //#include <iomanip>
  6. //#include "string.h"
  7. //#include <tlhelp32.h>
  8. //using namespace std;
  9. //int main()
  10. //{
  11. //  SetConsoleOutputCP(1251);
  12. //  SetConsoleCP(1251);
  13. //
  14. //HANDLE consoleOutput;
  15. //  COORD cursorPos;
  16. //  
  17. //  // Получаем хэндл консоли
  18. //  consoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); //получаем указатель на консоль
  19. //  int height,width;
  20. //      CONSOLE_SCREEN_BUFFER_INFO csbi;
  21. //  GetConsoleScreenBufferInfo( consoleOutput, &csbi );
  22. //  cout<<"Укажите ширину столбца: ";cin>>width;
  23. //  cout<<"Укажите высоту стобца: ";cin>>height;
  24. //  char probel=' ';
  25. //   cursorPos.X = 40;// Задаем координаты курсора и перемещаем курсор
  26. //  for(int i=0;i<height;i++)
  27. //  {
  28. //   
  29. //  cursorPos.Y = 4+i;
  30. //   SetConsoleCursorPosition(consoleOutput, cursorPos);//Установака положения текста
  31. //  SetConsoleTextAttribute(consoleOutput,(WORD)(1<<4|4) );//Утсновка цвета
  32. //  cout<<setw(width)<<setfill(probel)<<probel<<endl;
  33. //  }
  34. //
  35. //  SetConsoleTextAttribute( consoleOutput, csbi.wAttributes );
  36. //  return 0;
  37. //}
  38. //#include <iostream>
  39. //#include <iomanip>
  40. //using namespace std;
  41. //void main(int argc,char **argv)
  42. //{
  43. //    cout<<"   x  |          P"<<endl;
  44. //    cout<<"------------------------"<<endl;
  45. //    for(double x=-1; x<=2; x+=0.25)
  46. //    {
  47. //        double p=1/(x*x+1);
  48. //        for(int k=1; k<=13; k++) p*=k+x;
  49. //        cout<<setw(5)<<x<<" | ";
  50. //        printf(" %-16.5f \n",p);
  51. //    }
  52. //    
  53. //    system("pause");
  54. //}
  55.  
  56. //#include <iostream>
  57. //#include <iomanip>
  58. //#include <math.h>
  59. //using namespace std;
  60. //
  61. //int main()
  62. //{
  63. //    int n = 10;
  64. //    double x0 = -1 , xk = 3 , y, x,
  65. //    h = (xk + x0)/n;
  66. //    cout<<"__________________________________________\n";
  67. //    cout<<"|"<<setw(10)<<"X"<<setw(10)<<"|"<<setw(10)<<"Y"<<setw(10)<<"|"<<endl;
  68. //    cout<<"__________________________________________\n";
  69. //    for (x=x0 ;x<= 3 ; x=x+h)
  70. //    {
  71. //        if (x > 0)
  72. //        {
  73. //            y = x*sinh(x);
  74. //        }
  75. //        else if ( x <= 0)
  76. //        {
  77. //            y = (1 - cos(x))/(1 + 2*sin(3*x));
  78. //        }
  79. //    cout<<"|"<<setw(10)<<x<<setw(10)<<"|"<<setw(10)<<y<<setw(10)<<"|"<<endl;
  80. //    }              
  81. //    cout<<"-----------------------------------------\n";
  82. //    system("pause");
  83. //    return 0;  
  84. //}
  85.  
  86.  
  87. //#include "windows.h"
  88. //#include <iostream>
  89. //#include <tlhelp32.h>
  90. //#include "string.h"
  91. //
  92. //
  93. //const WORD colors[] =
  94. //      {
  95. //      0x1A, 0x2B, 0x3C, 0x4D, 0x5E, 0x6F,
  96. //      0xA1, 0xB2, 0xC3, 0xD4, 0xE5, 0xF6
  97. //      };
  98. //
  99. //int main()
  100. //{
  101. //HANDLE consoleOutput;
  102. //  COORD cursorPos;
  103. //
  104. //  // Получаем хэндл консоли
  105. //  consoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
  106. //
  107. //WORD   index   = 0;
  108. //
  109. //  // Remember how things were when we started
  110. //  CONSOLE_SCREEN_BUFFER_INFO csbi;
  111. //  GetConsoleScreenBufferInfo( consoleOutput, &csbi );
  112. //
  113. //  // Задаем координаты курсора и перемещаем курсор
  114. //  cursorPos.X = 30;
  115. //  cursorPos.Y = 3;
  116. //  SetConsoleCursorPosition(consoleOutput, cursorPos);
  117. //  SetConsoleTextAttribute( consoleOutput, 0xEC );
  118. //  // Выводим строку
  119. //  printf("Test string at position (30, 3)");
  120. //
  121. //  // Повторяем с другими координатами...
  122. //  cursorPos.X = 15;
  123. //  cursorPos.Y = 8;
  124. //  SetConsoleCursorPosition(consoleOutput, cursorPos);
  125. //  index++;
  126. //  SetConsoleTextAttribute( consoleOutput, colors[ index ] );
  127. //  printf("Test string at position (15, 8)");
  128. //
  129. // getchar();
  130. //
  131. //  return 0;
  132. //}
  133.  
  134. //#include "windows.h"
  135. //#include <iostream>
  136. //#include <iomanip>
  137. //using namespace std;
  138. //
  139. //void main()
  140. //{
  141. //
  142. //  HANDLE consoleOutput;
  143. //  COORD cursorPos;
  144. //
  145. //  // Получаем хэндл консоли
  146. //  consoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); //получаем указатель на консоль
  147. //
  148. //
  149. //  SetConsoleTextAttribute(consoleOutput, BACKGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY );//Утсновка цвета
  150. //      SetConsoleOutputCP(1251);
  151. //  SetConsoleCP(1251);
  152. //  char mass[3][15]={{"Бесман"},{"Лазарев"},{"Колыгин"}};
  153. //
  154. //  printf("+-----------------------+-----------------------+\n"
  155. //           "| Фамилия \t\t| Группа \t\t|\n"
  156. //           "+-----------------------+-----------------------+\n"
  157. //    );
  158. //    
  159. //    for ( int i=0;i<3;i++ )
  160. //        printf("| %-s \t\t| %-d    \t\t\t|\n"
  161. //               "+-----------------------+-----------------------+\n", mass[i],i+1
  162. //        );
  163. // 
  164. //   getchar();
  165. //    
  166. //    system("pause");
  167. //}
  168.  
  169. ///-----------------------------------------------------------------------------------------------------------------------
  170. //Подробный разбор всех функций
  171.  
  172. //#include "windows.h"
  173. //#include <iostream>
  174. //#include <tlhelp32.h>
  175. //#include "string.h"
  176. //
  177. //
  178. //int main()
  179. //{
  180. //
  181. //HANDLE consoleOutput;//что-то типа указателя на консоль
  182. //  COORD cursorPos;//координаты курсора
  183. //
  184. //
  185. //  consoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);//получаем адрес(хэндл консоли)
  186. //
  187. //  // Задаем координаты курсора и перемещаем курсор
  188. //  cursorPos.X = 30;
  189. //  cursorPos.Y = 3;
  190. //  SetConsoleCursorPosition(consoleOutput, cursorPos);
  191. //
  192. //  // Выводим строку
  193. //  printf("Test string at position (30, 3)");
  194. //
  195. //  // Повторяем с другими координатами...
  196. //  cursorPos.X = 15;
  197. //  cursorPos.Y = 8;
  198. //  SetConsoleCursorPosition(consoleOutput, cursorPos);
  199. //
  200. //  printf("Test string at position (15, 8)");
  201. //
  202. // getchar();
  203. //
  204. //  return 0;
  205. //}
  206. //
  207. //#include "windows.h"
  208. //#include <iostream>
  209. //#include <tlhelp32.h>
  210. //#include "string.h"
  211. //
  212. ////typedef BOOL (WINAPI *SETCONSOLEFONT)(HANDLE, DWORD);     // прототип недокументированый функции
  213. //// SETCONSOLEFONT SetConsoleFont;
  214. //
  215. //const WORD colors[] =
  216. //      {
  217. //      0x1A, 0x2B, 0x3C, 0x4D, 0x5E, 0x6F,
  218. //      0xA1, 0xB2, 0xC3, 0xD4, 0xE5, 0xF6
  219. //      };
  220. //
  221. //int main()
  222. //{
  223. //
  224. //  //HANDLE hstdin  = GetStdHandle( STD_INPUT_HANDLE  );//заголовок потока //ввода
  225. //  HANDLE hstdout = GetStdHandle( STD_OUTPUT_HANDLE );
  226. //  int   index   = 0;
  227. //
  228. //  // Remember how things were when we started
  229. //  CONSOLE_SCREEN_BUFFER_INFO csbi;
  230. //  GetConsoleScreenBufferInfo( hstdout, &csbi );//объект запоминающий даннные о атрибутах консоли
  231. //
  232. //  // Tell the user how to stop
  233. //  SetConsoleTextAttribute( hstdout, 0xEC );
  234. //  //std::cout << "Press any key to quit.\n";
  235. //printf ("press any key \n");
  236. // 
  237. //  while (index<13)
  238. //  {
  239. //      SetConsoleTextAttribute( hstdout, colors[ index ] );
  240. ////        std::cout << "\t\t\t\t Hello World \t\t\t\t" << std::endl;
  241. //              printf("\t\t\t\t Hello World \t\t\t\t\n");
  242. //          std:: cout<<"sizeof(colors):"<<sizeof(colors)<<std::endl;
  243. //           std:: cout<<"sizeof(colors[0])"<<sizeof(colors[0])<<std::endl;
  244. //      if (++index > sizeof(colors)/sizeof(colors[0]))
  245. //          break;
  246. //  }
  247. //  //FlushConsoleInputBuffer( hstdin ); // очистить буфер
  248. //
  249. // 
  250. //  SetConsoleTextAttribute( hstdout, csbi.wAttributes );
  251. //    getchar();
  252. //  return 0;
  253. //}
  254.  
  255. //#include "windows.h"
  256. //#include <iostream>
  257. //#include <tlhelp32.h>
  258. //#include "string.h"
  259. //
  260. //
  261. //const WORD colors[] =
  262. //      {
  263. //      0x1A, 0x2B, 0x3C, 0x4D, 0x5E, 0x6F,
  264. //      0xA1, 0xB2, 0xC3, 0xD4, 0xE5, 0xF6
  265. //      };
  266. //
  267. //int main()
  268. //{
  269. //HANDLE consoleOutput;
  270. //  COORD cursorPos;
  271. //
  272. //  // Получаем хэндл консоли
  273. //  consoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
  274. //
  275. //WORD   index   = 0;
  276. //
  277. //  // Remember how things were when we started
  278. //  CONSOLE_SCREEN_BUFFER_INFO csbi;
  279. //  GetConsoleScreenBufferInfo( consoleOutput, &csbi );
  280. //
  281. //  // Задаем координаты курсора и перемещаем курсор
  282. //  cursorPos.X = 30;
  283. //  cursorPos.Y = 3;
  284. //  SetConsoleCursorPosition(consoleOutput, cursorPos);
  285. //  SetConsoleTextAttribute( consoleOutput, 0xEC );
  286. //  // Выводим строку
  287. //  printf("Test string at position (30, 3)");
  288. //
  289. //  // Повторяем с другими координатами...
  290. //  cursorPos.X = 15;
  291. //  cursorPos.Y = 8;
  292. //  SetConsoleCursorPosition(consoleOutput, cursorPos);
  293. //  index++;
  294. //  SetConsoleTextAttribute( consoleOutput, colors[ index ] );
  295. //  printf("Test string at position (15, 8)");
  296. //
  297. // getchar();
  298. //
  299. //  return 0;
  300. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement