# 一、作业

## 基础作业

### 实验代码：

``````#include <stdio.h>

int main()
{
FILE  fopen("YQ.txt", "a+");

int a[10000000], count = 0;
char c;

int i = 0;
int  value;

while (true)
{
fscanf(YQ, "%d%c", &value, &c);
count++;
a[i] = value;
i++;
if (c == '\n') break;
}

int max = a[0];
int sum,start,end;

for (int i = 0; i < count; i++)
{
for (int j = i; j < count; j++)
{
sum = 0;
for (int comp = i; comp < j+1; comp++)
{
sum += a[comp];
}
}
}

if (sum >= max)
{
start = i;
end = j;
max = sum;
}
}

for (int i = start; i <= end; i++)  {
fprintf(input, "%d ", a[i]);  }

fprintf(input, "\n%d", max);

return 0;
}
``````

## 预习作业

·`c 2 3 1 2 3 0 4 5 0 0 6 2 1 0 -8 2`

``````YES

NO``````

### 实验代码：

``````#include<stdio.h>
int main()
{
int T;
scanf("%d\n",&T);

int i,j,x,ABC;
int a[10][10],X[100];
for(x=1;x<=T;x++)
{
ABC=1;
scanf("%d\n",&X[x]);
for(i=0;i<X[x];i++)
{
for(j=0;j<X[x];j++)
{       scanf("%d",&a[i][j]);
if(i>j)
{        if(a[i][j]!=0);
{
ABC=0;
}
}
}
}
if(ABC) printf("YES\n");
else printf("NO\n");
}

return 0;
}  ``````

# 二、学习进度条

3/1-3/8 46h 78 定义文件，以及文件的导入导出和读写
3/9-3/15 12h 42 ....未上课

0条评论