保留有效数字也可以用round(x,n)的吧~
x是你要进行操作的对象,
n就是要保留的有效数字的
位数
#include <stdio.h>#include <string.h>
int main()
{
char s[100]
FILE *fp1, *fp2
fp1 = fopen("in.txt", "r")
fp2 = fopen("out.txt", "w")
if(fp1 == NULL || fp2 == NULL) return -1
while(~fscanf(fp1, "%s", s))
if(strchr(s, '.')) fprintf(fp2, "%s ", s)
fcloseall()
rename("in.txt", "out.txt")
return 0
}
一般是两位。R语言数据结构其实以数据类型的方式出现,有数据框,数组、向量和矩阵,因子和列表。
数据框dataframe是统计专业常用数据集,而因子factor是分类所用的方法,表明了R语言鲜明的经济统计色彩。