//
// main.m
// 第一节作业
//
// Created by dllo on 15/11/10.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {

//第一题
    //  二进制 101010
    //  八进制 052
    //  十六进制    0x2A
//第二题
    //214

//第三题
    //61
//第四题
    //  168
//第五题
    printf("   *\n  * *\n * * *\n");
//第六题

/* int us = 0;

printf("Enter an amount:");
scanf("%d.2\n", &us);
double  as = us;
printf("Enter an amount: %.2f\n", as);
double sc = us * 1.05;
printf("With tax added: %.2f\n", sc);
*/
//第七题

/*

int a = 0, b = 0;
printf("请输入一个实数:");
scanf("%d",&a);
printf("请再输入一个实数:");
scanf("%d",&b);


double e = a * 1.0 /b * 100;
printf("输出:%.2f%%",e);
*/
//第八题
/*
 // 不会,网上查的,但还是不明白!
int a8 = 0;

printf("Enter a dollar amout:");

scanf("%d", &a8);

printf("$20  bills:%d\n", a8 / 20);

printf("$10  bills:%d\n", a8 % 20 / 10);

printf("$5   bills:%d\n", a8 % 10 / 5);

printf("$1   bills:%d\n", a8 % 5);
 */
//第九题
/*
 int a9 = 0, b9 = 0;
printf("请输入一个整数:");
scanf("%d",&a9);
printf("请输入一个整数:");
scanf("%d",&b9);
int c9 = a9 + b9;
int d9 = a9 - b9;
int e9 = a9 * b9;
int f9 = a9 / b9;
printf("和%d\n差%d\n积%d\n余数%d\n", c9, d9, e9, f9);
*/
//第十题
/*
//也不太明白
int a10 = 0;

printf("输入ASCII-A或者65");
scanf("%d",&a10);
printf("ASCII值为%d对应的字符为:%c\n",a10,a10);
char  b10 = '0';
scanf("%c", &b10);
printf("字符为%c对应的字符为%d\n",b10,b10);

*/

return 0;

}
第一节作业.key.zip

Yiem的博客-iOS