This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| double max1(double a, double b); | |
| double max1(double a, double b, double c); | |
| using namespace std; | |
| int main() { | |
| double a, b, c; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| double t(double x); | |
| double sum1(double x); | |
| double sum2(double x); | |
| using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cmath> | |
| double f(double a, double b, double c); | |
| using namespace std; | |
| int main() { | |
| double s, t; | |
| cin >> s >> t; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| const int size = 10; | |
| int SummArr(int arr[], int size); | |
| double Average(int arr[], int size); | |
| int NumOfNegative(int arr[], int size); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| long long n, a, b=1,sum=0; | |
| cin >> n >> a; | |
| if (a==0) cout << "0\n"; else | |
| if (a==1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void chooseSort(int a[], int size) { | |
| for (int i=0; i<size-1; i++) { | |
| int nMin = i; | |
| int min = a[nMin]; | |
| for (int j=i+1; j<size; j++) { | |
| if (a[j]<min) { | |
| min = a[j]; | |
| nMin = j; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void bubbleSort(int a[], int size) { | |
| for (int i=size-2; i>=0; i--) { | |
| bool obmen = false; | |
| for (int j=0; j<=i; j++) { | |
| if (a[j]>a[j+1]) { | |
| int t = a[j]; | |
| a[j] = a[j+1]; | |
| a[j+1] = t; | |
| obmen = true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void insertSort(int a[], int size) { | |
| for (int i=1; i<size; i++) { | |
| int t = a[i]; | |
| int j=i-1; | |
| for (; j>=0; j--) { | |
| if (a[j] > t) { | |
| a[j+1] = a[j]; | |
| } else { | |
| break; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void quickSort(int arr[], int size); | |
| void sort(int a[], int left, int right) { | |
| // На входе - массив a[] и пределы сортировки | |
| int i = left, j = right-1; // поставить указатели на исходные места | |
| int temp, p; | |
| p = a[ (i + j) / 2 ]; // центральный элемент | |
| // процедура разделения | |
| do { | |
| while ( a[i] < p ) i++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lesson6; | |
| import java.io.BufferedReader; | |
| import java.io.File; | |
| import java.io.FileNotFoundException; | |
| import java.io.FileReader; | |
| import java.io.IOException; | |
| import java.io.PrintWriter; | |
| import java.util.Scanner; |
OlderNewer