自學第七十九天

//#include<stdio.h>
//int main()
//{
//	float aboat = 32000.0;
//	double abet = 2.14e9;
//	long double dip = 5.32e-5;
//	printf("%f can be written %e\n", aboat, aboat);
//	printf("And it's %a in hexadecimal, powers of 2 notation\n", aboat);
//	printf("%f can be written %e\n", abet, abet);
//	printf("%Lf can be written %Le\n", dip, dip);
//	return 0;
//}

//#include<stdio.h>
//int main()
//{
//	float salary;
//	printf("\aEnter your desired monthly salary:");//\a是發生一聲警報
//	printf("$_______\b\b\b\b\b\b\b");//\b是向左移動一格
//	scanf("%f", &salary);
//	printf("\n\t$%.2f a month is $%.2f a year.", salary, salary * 12.0);//\t意思是水平製表符使光標移至該行的下一個製表點,通常是第9列
//	printf("\rGee!\n");//\r意思是使光標回到當前行的起始處
//	return 0;
//}

//#include<stdio.h>
//#include<string.h>
//#define DENSITY 62.4//定義一個宏【注意】後面沒有分號。
//int main()
//{
//	float weight, volume;
//	int size, letters;
//	char name[40];
//	printf("Hi! What's your first name?\n");
//	scanf("%s", &name);
//	printf("%s, What's your weight in pounds?\n", name);
//	scanf("%f", &weight);
//	size = sizeof(name);
//	letters = strlen(name);
//	volume = weight / DENSITY;
//	printf("Well,%s,your volume is %2.2f cubic feet.\n", name, volume);
//	printf("Also, your first name has %d lettes,\n", letters);
//	printf("and we have %d bytes to store it.\n", size);
//	return 0;
//}
相關文章
相關標籤/搜索