My Opera is closing 3rd of March

Ký ức thời gian

Có một thời để nhớ ...

Làm bài tập C++ (7)

Chương trình tính lãi suất ngân hàng:
Input: Tiền vốn, số tháng gửi, lãi suất
Output: Tổng số tiền nhận được sau khi gửi
(Tính theo lãi suất kép)

//Chuong trinh tinh lai suat ngan hang

# include <stdio.h>
# include <conio.h>

long tinhlaisuat (long von, int sothang, float laisuatpt){
	int i;
        long tong;
        tong=von;
	for (i=1;i<=sothang;i++)
        	tong=(long)(tong + von*laisuatpt/100);
	return tong;
}

void main()
{
int sthang; //so thang gui tien
long sovon,sotien; //so tien gui
float lspt; //lai suat phan tram tren thang

printf("Nhap so tien gui ban dau: ");scanf("%ld",&sovon);
printf("Nhap so thang muon gui  : ");scanf("%d",&sthang);
printf("Nhap lai suat phan tram : ");scanf("%f",&lspt);

sotien=tinhlaisuat(sovon,sthang,lspt);
printf("\nSo tien co duoc sau khi gui la: %ld (dong)",sotien);
getch();
}

Làm bài tập C++ (6)Làm bài tập C++ (8)