enum Type3Values {t3One, t3Two, t3Three};
class Type3 {
protected:
Type3Values value;
public:
Type3();
//Ваши операции
Type3Values oper1(Type3Values v);
Type3Values oper2(Type3Values v);
Type3Values oper3(Type3Values v);
//Операции для bool
... oper1(bool v);
... oper2(bool v);
... oper3(bool v);
};
int getMin(int numbers[], int size);
int main(){
int numbers[10] = { 0, 2, 4, 6, 1, 3, 8, 7, 9, 5 };
int res = getMin(numbers, 10);
printf("%d\n", res);
getchar();
}
int getMin(int numbers[], int size){
int key = 0;
int min = numbers[0];
for (int i = 1; i < size; i++){
if (min > numbers[i]){
min = numbers[i];
key = i;
}
}
return key;
}
#include <windows.h>
#include <iostream>
using namespace std;
int main()
{
cout << "Test mul" << endl;
int tick1 = GetTickCount();
double a = 1000000000000;
for (int i = 0; i < 1000000; i++) {
a *= 0.99;
}
int tick2 = GetTickCount();
cout << "time = " << tick2 - tick1 << endl;
cout << a << endl;
cout << "Test div" << endl;
tick1 = GetTickCount();
a = 1000000000000;
for (int i = 0; i < 1000000; i++) {
a /= 1.0001;
}
tick2 = GetTickCount();
cout << "time = " << tick2 - tick1 << endl;
cout << a << endl;
}
Test mul
time = 47
2.42092e-322
Test div
time = 16
3.73872e-32