第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

網(wǎng)點(diǎn)數(shù)據(jù)類型轉(zhuǎn)換為中轉(zhuǎn)型EXCLE格式

標(biāo)簽:
C
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

int main()
{
//=====================================================
//基本数据

    const int startlon = 9755;//起始经度(97.55*100)
    const int startlat = 3995;//起始纬度
    const int xrolls = 2; //行数
    const int yrolls = 4;//列数
    const int step = 10;//步长(0.1*100)
    const int filenumber = 3;//文件总个数
    float data[xrolls][yrolls];

//======================================================
//文件操作
    char infilename[100];
    FILE* fout,*fin;
    fout = fopen("F:\\2017C\\test.txt", "a+");
    int dlon, dlat;
    //对纬度,对经度循环
    for (dlat = 0; dlat < xrolls; dlat++){
        for (dlon = 0; dlon <yrolls; dlon++){

            float lon = (dlon*step + startlon)*0.01;
            float lat = (dlat*step + startlat)*0.01;
            fprintf(fout, "%6.2f""%6.2f", lon, lat);

            //对文件开始循环
            for (int filecount = 1; filecount <= filenumber; filecount++){

                sprintf(infilename, "F:\\2017C\\test%d.txt", filecount);//读入位置!!修改

                fin = fopen(infilename, "r");
                if (!infilename){
                    printf("could not open file!");
                    exit(99);
                }

                //读入数据
                while (!feof(fin))
                {

                    for (int i = 0; i < xrolls; i++){   //i<行数
                        for (int j = 0; j < yrolls; j++){   //j<列数
                            fscanf(fin, "%f", &data[i][j]);
                        }
                    }

                }

                //写入数据
                if (filecount == filenumber)fprintf(fout, "%6.2f\n", data[dlat][dlon]);//如果是横排最后一个,则输入回车
                else fprintf(fout, "%6.2f", data[dlat][dlon]);//(行,列)==(纬度,经度)

                fclose(fin);
            }
        }
    }

        fclose(fout);
        return 0;

}
1.11    2.22    3.33    4.44
5.55    6.66    7.77    8.88
//testx.txt

//lon lat Jan Feb Mar............
97.55 39.95 0.00 1.11 3.11
97.65 39.95 1.00 1.22 3.22
97.75 39.95 2.00 1.33 3.33
97.85 39.95 3.00 1.44 3.44
97.55 40.05 4.00 2.11 3.55
97.65 40.05 5.00 2.22 3.66
97.75 40.05 6.00 2.33 3.77
97.85 40.05 7.00 2.44 3.88
//test.txt

點(diǎn)擊查看更多內(nèi)容
2人點(diǎn)贊

若覺得本文不錯(cuò),就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報(bào)

0/150
提交
取消