⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compute-bw-normal.c

📁 对IEEE 802.11e里的分布式信道接入算法EDCA进行改进
💻 C
字号:
#include <stdio.h>#include <stdlib.h>/* Compute the maximum between the number in   * the second column                  *  * Input: *   src1, src2 - two columns files * *   res - two column file */int main(int argc, char **argv) {  FILE *df1, *df2;  	int nodes;	  float sending_rate;  float ratio;	float good1;			ratio = 0.0;  good1 =0.0;  if (argc != 4) {    //printf("Ussage: %s srcfile nflows \n", argv[0]);    exit(-1);  }  if (!(df1 = fopen (argv[1], "r"))) {    printf ("fopen() failed\n");    exit (1);  }	if (!(df2 = fopen (argv[2], "w"))) {    printf ("fopen() failed\n");    exit (1);  }  	sending_rate = atof(argv[3]);		while ((!feof(df1)) && (!feof(df2))) {				fscanf(df1, "%d%f\n", &nodes, &good1);		ratio = good1 / sending_rate;				fprintf(df2,"%d\t%f\n", nodes,ratio);				//printf("nodes %d\t ratio %f\n", nodes,  ratio);  }   		  fclose(df1);  fclose(df2);  }  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -