Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://vk.com/evgenykravchenko0
- ___ ___ ___
- / /\ ___ / /\ / /\
- / /:/_ /__/\ / /:/_ / /:/_
- / /:/ /\ \ \:\ / /:/ /\ / /:/ /\
- / /:/ /:/_ \ \:\ / /:/_/::\ / /:/ /:/_
- /__/:/ /:/ /\ ___ \__\:\ /__/:/__\/\:\ /__/:/ /:/ /\
- \ \:\/:/ /:/ /__/\ | |:| \ \:\ /~~/:/ \ \:\/:/ /:/
- \ \::/ /:/ \ \:\| |:| \ \:\ /:/ \ \::/ /:/
- \ \:\/:/ \ \:\__|:| \ \:\/:/ \ \:\/:/
- \ \::/ \__\::::/ \ \::/ \ \::/
- \__\/ ~~~~ \__\/ \__\/
- ___
- /__/\ ___ ___
- \ \:\ / /\ / /\
- \ \:\ / /:/ / /:/
- _____\__\:\ /__/::\ /__/::\
- /__/::::::::\ \__\/\:\__ \__\/\:\__
- \ \:\~~\~~\/ \ \:\/\ \ \:\/\
- \ \:\ ~~~ \__\::/ \__\::/
- \ \:\ /__/:/ /__/:/
- \ \:\ \__\/ \__\/
- \__\/
- #include <stdio.h>
- //СУММА ДВУХ ЧИСЕЛ
- float amount(float a, float b)
- {
- float sum ;
- sum = a + b;
- return sum;
- }
- //РАЗНОСТЬ ДВУХ ЧИСЕЛ
- float difference(float a, float b)
- {
- float dif ;
- dif = a - b;
- return dif;
- }
- //УМНОЖЕНИЕ ДВУХ ЧИСЕЛ
- float multiplication(float a, float b)
- {
- float multi ;
- multi = a * b;
- return multi;
- }
- //ДЕЛЕНИЕ ДВУХ ЧИСЕЛ
- float degree(float a, float b)
- {
- float deg ;
- deg = a / b;
- return deg;
- }
- //ВОЗВЕДЕНИЕ ЧИСЛА В СТЕПЕНЬ
- float power(float a, float b)
- {
- if (b == 0)
- return 1;
- else
- return a * power(a, b - 1);
- }
- float power_rev(float a, float b)
- {
- return 1/power(a,-b);
- }
- //МОДУЛЬ ЧИСЛА
- float modulo (float a)
- {
- if (a>=0)
- return a;
- else
- return -a;
- }
- //основная программа
- int main() {
- float count ;
- float count2 ;
- float count3 ;
- float count4 ;
- float count5 ;
- float count6 ;
- float count7 ;
- float count8 ;
- float count9 ;
- float count10 ;
- float count11 ;
- count = power(3,7);
- printf("%f\n", count);
- count2 = difference(2,5);
- printf("%f\n", count2);
- count3 = degree(count,count2);
- printf("%f\n", count3);
- count4 = multiplication(0.3,21);
- printf("%f\n", count4);
- count5 = power(2,6);
- printf("%f\n", count5);
- count6 = difference(count4,count5);
- printf("%f\n", count6);
- count7 = modulo(count6);
- printf("%f\n", count7);
- count8 = power(count7,2);
- printf("%f\n", count8);
- count9 = power_rev(-3,-2);
- printf("%f\n", count9);
- count10 = degree(1,count9);
- printf("%f\n", count10);
- count11 = amount(count8,count10);
- printf("%f\n", count11);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement