自制填盘工具
附代码:
#include<bits/stdc++.h>
#include<conio.h>
#define _for(i,a,b) for(long long i=(a);i<(b);i++)
#define B 1
#define KB 1024
#define MB 1024*1024
#define GB 1024*1024*1024
#define TB 1024*1024*1024*1024
#define PB 1024*1024*1024*1024*1024
using namespace std;
bool lzssb=1;
const char a[6][3]={"B","KB","MB","GB","TB","PB"};
const long long c[6]={B,KB,MB,GB,TB,PB};
long long n;
char d[3];
ofstream tp("tianpan.txt");
int main(){
printf("请输入填盘大小:(num + 容量单位) ");
scanf("%lld%2s",&n,d);
long long b;
if(d[0]=='B')b=n ;
if(d[0]=='K')b=n*1024;
if(d[0]=='M')b=n*1024*1024;
if(d[0]=='G')b=n*1024*1024*1024;
if(d[0]=='T')b=n*1024*1024*1024*1024;
if(d[0]=='P')b=n*1024*1024*1024*1024*1024;
_for(i,0,b+1){
tp<<0;
if(i%50000000==0){
system("cls");
double t=i;
t/=b*1.0;
t*=100*1.0;
printf("填盘中... 已完成 %.2f%%",t);
}
}
system("cls");
printf("填盘完毕! 共填盘:%lld%s",n,d);
getch();
return 0;
}