zoukankan      html  css  js  c++  java
  • 第二周作业

    1、实验代码:

    include<stdio.h>

    include<stdlib.h>

    int main(void)
    {
    FILE * fp;
    int i,n,b=0,d=0,e=0;
    int a[10];
    if((fp=fopen ("C:caoeTXT.txt","w+"))NULL){
    printf("File open error! ");
    exit (0);
    }
    for(j=0;j<n;j++)
    {
    if(a[0]<a[j])
    {
    a[0]=a[j];
    i=j;
    }
    else if(a[0]
    a[j])
    {
    a[0]=a[j];
    if(i>j)
    {
    i=j;
    }
    }
    }
    printf("%d %d",a[0],i);
    if(fclose(fp)){
    printf("Can not close the file! ");
    exit (0);
    }
    return 0;
    }
    2编辑图片

    3遇到的问题
    在c++上面编辑的时候,老是忘记加入数组,然后就是在写文件格式的时候把文名打上去了,后来改正过来了

  • 相关阅读:
    17111 Football team
    Train Problem I (HDU 100题纪念)
    迷宫问题
    图形点扫描
    看病要排队(stl)
    水果
    Prime Ring Problem
    N皇后问题
    2^x mod n = 1
    Queuing
  • 原文地址:https://www.cnblogs.com/shihao0701/p/10501118.html
Copyright © 2011-2022 走看看