// realAbb.cpp: Hauptprojektdatei.

#include "stdafx.h"
#include <cstdio>
#include <string>
#include "math.h"
#include <iostream>

using namespace std;

int f1(int n){
	int Erg=0;
	while (n>0) {
		Erg=Erg+n;
		n--;
	}
	return(Erg);
}

int f2(int a, int &b){
	int d=0;
	int Erg;
	while (a>0) {
		d++;
		a=a-b;
	}
	Erg=a+b;
	b=d;
	return(Erg);
}
int f3(int x, int y){
	int Erg=1;
	while (y>0) {
		if ((y % 2) == 0){
			y=y / 2;
			x=x*x;
		} else {
			y=y-1;
			Erg=Erg*x;
		}
	}
	return(Erg);
}


int main(array<System::String ^> ^args)
{
	int a=17, b=4, Erg=0;
    Erg=f1(b);
	Erg=f2(a,b);
	a=5; b=4;
	Erg=f3(a,b);
    return (0);
}
