Публикации рубрики - Программирование. Страница: 661

На этой странице собрано около (~) 13675 публикаций, конспектов, лекций и других учебных материалов по направлению: Программирование. Для удобства навигации можете воспользоваться навигацией внизу страницы.

Чтение и запись текстовых файлов.

ЛекцияТекстовые файлы (продолжение )Задача 1.Задан файл (.txt) целых чисел.Записать его в другой файл , используя функцию eof() //arb2014_file1 #include<fstream> #include<iostream> using namespace std; void main() { ifstream in("arb.txt"); ofstream out("out.txt"); ofstream

Подсчитать число вхождений строки t в строке u

Удалить все вхождения подстроки t в строке uВ строке u заменить все вхождения подстроки t на подстроку s //arb2009_string_substring_fun3 #include<iostream.h> #include<string.h> //#include<stdio.h> // get() <stdio.h> const int n=100; //////////////////////////////////////////////////////////// void strcpy1(char

Функции cin.Get(), cin.Getline().

//arb2015_get_getline #include <iostream> using namespace std; void main() { const int n=30; char S; cout<<" new line ch= "<<(int)'\n'<<endl;//10 cout<<" 0-symbol ch= "<<(int)'\0'<<endl;//0 cout<< "enter S1="<< endl; cin.getline(S,n); //Ввод строки Kazan State University cout<<" S1="<<S<<endl;

Вторая версия вычисление интеграла без файла

// integral_function //arb2014_integral_function_without_file #include<iostream> #include<math.h> #include<iomanip> #include<string> using namespace std; const int lengthColumn=20; const int Indent=7; const int lengthTable=43; ////////////////////////// double Fi(double x) { return cos(x)*cos(x); } /////////////////////////////// double Psi(double x) { return (1-x*x)/(1+x*x); }

Даны два двумерных массива A и B (квадратные матрицы).

Матрица С= A* B, если в А существует строка простых чисел. В противном случае С= A+ B # include <iostream.h> # include <math.h> void create ( int **, int); void show( int **, int); bool prime (int); bool EA( int **, int); void mult ( int **, int**, int**); void add ( int **, int**, int**);Void main(){ int n; cout<<”enter size=”;

Основы использования функций.

Функции – этьо подпрограммы , которые содержат одну или несколько инструкций. Функции называются строительными блоками С++, поскольку программа в С++ , как правило, представляет собой коллекцию функций. Общий формат С++ функций

Задачи с двумерными массивами

Вычислить сумму произведений элементовy = ∑in-1 ∏jn-1aij # include <iostream.h> const int n=5; void main() { int a ;; int i, j, y, p; //Ввод массива с клавиатуры cout<<”enter array a:”<<endl; for (i=0; i<n; i++) for (j=0; j<n; j++) cin>>a; //Вывод массива на экран cout<<” array

Алгоритм сортировки методом нахождения локальных экстремумов

Необходимо отсортировать массив удовлетворяющий условию (Ai)<=a ]. ( для любого i справедливо а<=a ) В цикле проверяем условие, если a >a , то a и aменяем местами # include <iostream.h> const int n=10; void main() { int a; int i, j,r; //Ввод массива с клавиатуры

Стадия 3. компиляция программы

На третьей стадии компилятор транслирует программу на С++ в код машинного языка ( называемый также объектным кодом )Стадия 4. Компоновка.Четвертая стадия называется компоновкой (linking). Программы С++ обычно содержат ссылки на

Стадия 2. Препроцессорная обработка программы

Первый семестрЛитература1. Герберт. Шилдт. С++ руководство для начинающих 2. Т.А. Павловская. С/С++ Программирование на языке высокого уровня 3. Никлаус Вирт. Алгоритмы и структуры данных 4. Т.А. Павловская, Ю.А. Щупак С/C++ Структурное

Ex. 71 Read the text and summarise it in 100 words.

Bill Napolitano— a New York City CopBill Napolitano's police uniform is more than just a shirt, slacks, and a cap. He also has to carry a radio, two pairs of handcuffs, a flashlight, a set of keys, a notebook, a heavy stick, and a .38 Smith and Wesson gun. You might think that the gun is the most important item. But Bill has been a New York City cop for three years, and he hasn't used it once. In fact, it's his

In what way can jury service “help in the wake of the attacks on the U.S.€

Why is serving on the jury compared to voting? What is common between the two procedures?Who has the right to serve on the jury?What should you do if you receive a summons to serve on the jury?What are the two types of trials which require the service of the jury?Judging by the article, do you think that the American perceive jury duty more as a privilege or responsibility?Ex. 70 Read the text and fill in the

Ex. 68 Read the text and complete the statements below by choosing the answer which you think fits best.

Courtroom TechnologyIn the modern courtroom, technology plays an important part in facilitating the trial process. Evidence presentation now includes computers, audio/video devices, video conferencing, televisions, electronic data storage, and viewing monitors. Courts recognize that having an efficient evidence presentation system is essential in order to disseminate information quickly, maintain accurate record,

Ex. 67 Read the text about the court system of the USA and draw a diagram illustrating the structure of the system.

The Courts state courts The Constitution recognizes that the states have certain rights and authorities beyond the power of the federal government. States have the power to establish their own systems of criminal and civillaws, with the result that each state has its own laws, prisons, police force, and state court. Within each state, there are also county and city courts. Generally, state laws are quite similar,

In what way has the citizens’ attitude towards the police changed in Britain over the last twenty-five years? Are there any similar trends in Ukraine?

3. To what extent is the way the public feel about the police important for efficient work of the police? 4. What are the suggested ways out of the present situation? What could be said against the introduction of these measures? 5. What other measures for enhancing the efficiency of the police work would you suggest?B. Discussion.In Britain, the average salary of an eighteen-year-old trainee police officer is about

Give examples and/or reasons to support your opinion.

Ex. 60 Read the text and write out the words and word combinations connected with the work of the police fitting them into the following categories: people weapons departments activities         Each of Britain’s fifty-two police forces is responsible for law enforcement in its own area. Some special services, such as the Fraud Squad (who investigate financial crimes), are

Courts in the uk Criminal courts

The most common type of law court in England and Wales is the magistrates’ court. There are 700 magistrates’ courts and about 30,000 magistrates (Justices of Peace, or JPs). JPs are usually unpaid and have no formal legal qualifications, but they are respectable people who are given some training. A court normally consists of three lay magistrates who are advised on points of law by a legally qualified clerk.