[ create a new paste ] login | about

Link: http://codepad.org/9NYfKSAv    [ raw code | fork ]

Debanjan - C, pasted on Sep 25:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>


int main(void)
{
	double bytes_sent, bytes_received;

	scanf("%*s%*s%*s%*s%*s%lf%lf",&bytes_received, &bytes_sent);

	printf("Net usage statistics:\n");
	printf("---------------------\n");
	printf("Sent:     %8.3f MiB\n", bytes_sent / ((double)(1024 * 1024)));
	printf("Received: %8.3f MiB\n", bytes_received / ((double)(1024 * 1024)));
	printf("Total:    %8.3f MiB\n\n", (bytes_sent + bytes_received) / ((double)(1024 * 1024)));


	return 0;
}


Create a new paste based on this one


Comments: