bai tap thuc hanh
Page 1 of 1
bai tap thuc hanh
#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);
}
#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);
}
sallowery- Đã biết nói
- Tổng số bài gửi : 21
Join date : 2009-10-25
Age : 33
Đến từ : Củ Chi
Similar topics
» BÀI THỰC HÀNH MIPS
» Tài liệu thực hành môn tin học cơ sở và nhập môn lập trình. (27/10/2009)
» code bài thực hành cộng trừ chuyển đổi số nguyên và nhị phân
» Hạnh Phúc Nơi Đâu
» Ít người biết thưởng thức nhạc rap lắm
» Tài liệu thực hành môn tin học cơ sở và nhập môn lập trình. (27/10/2009)
» code bài thực hành cộng trừ chuyển đổi số nguyên và nhị phân
» Hạnh Phúc Nơi Đâu
» Ít người biết thưởng thức nhạc rap lắm
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|