Diễn đàn CK4
Would you like to react to this message? Create an account in a few clicks or log in to continue.

bai tap thuc hanh

Go down

bai tap thuc hanh Empty bai tap thuc hanh

Post by sallowery 2010-03-25, 9:03 am

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
void nhap(int a[], int &n)
{

srand(clock());
for(int i=0;i<n;i++)
{
printf("\nnhap phan tu a[%d]",i);

a[i]=rand()%100;
}
}
void xuat(int a[], int n)
{
for(int i=0;i<n;i++)
{
printf("%10d", a[i]);

}
}
// r;read
//t:text

void luu(char*ten, int a[], int &n)
{
FILE*f=fopen(ten,"wt");
if(f!=0)//mo file thanh cong
{
fprintf(f," %d ",&n);

for(int i=0;i<n;i++)
{
fprintf(f," %d ",a[i]);
}
}
fclose(f);
}
void main(int t,char*argv[])
{
int c=atoi(argv[1]);
int b=atoi(argv[2]);
int s=b+c;
printf("%d",s);

}
Smile Smile
sallowery
sallowery
Đã biết nói
Đã biết nói

Tổng số bài gửi : 21
Join date : 2009-10-25
Age : 33
Đến từ : Củ Chi

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum