Решение. #include Strings.h // File main.c
#include <stdio.h>
#include "Strings.h"
// File main.c
#include <stdio.h>
#include "Strings.h"
int main(void)
{
char strs[MSTRS][MLEN + 1];
int n;
printf("n=");
scanf("%d%*c", &n);
input_arr_strs(strs, n);
printf("\n\n");
output_arr_strs(strs, n);
return 0;
}
// File Strings.h
#ifndef STRINGS_H_INCLUDED
#define STRINGS_H_INCLUDED
#define MSTRS 20
#define MLEN 80
void input_arr_strs(char ar[][MLEN + 1], int n);
void output_arr_strs(const char ar[][MLEN + 1], int n);
#endif // STRINGS_H_INCLUDED
// File Strings.c
#include "Strings.h"
#include <stdio.h>
void input_arr_strs(char ar[][MLEN + 1], int n)
{
for(int i = 0; i < n; i++)
{
printf("#%d->", i + 1);
gets(ar[i]);
}
}
void output_arr_strs(const char ar[][MLEN + 1], int n)
{
printf("%5s\t%-50s\n", "I", "STS");
for(int i = 0; i < n; i++)
{
printf("%5d\t%-50s\n", i + 1, ar[i]);
}
}
Дата добавления: 2014-01-06 ; Просмотров: 263 ; Нарушение авторских прав? ; Мы поможем в написании вашей работы!
Нам важно ваше мнение! Был ли полезен опубликованный материал? Да | Нет