C语言-符号常量

root@iZuf6evbev3w2mqyyrgfcqZ:~/codec# more symbol.c 
#include <stdio.h>
#define LOWER 0
#define UPPER 300
#define STEP 20

int main()
{
    int fahr;
    for (fahr = LOWER; fahr <= UPPER; fahr = fahr + STEP) printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32));
    return 0;
}
root@iZuf6evbev3w2mqyyrgfcqZ:~/codec# cc symbol.c -o sym.out
root@iZuf6evbev3w2mqyyrgfcqZ:~/codec# ./sym.out
  0  -17.8
 20   -6.7
 40    4.4
 60   15.6
 80   26.7
100   37.8
120   48.9
140   60.0
160   71.1
180   82.2
200   93.3
220  104.4
240  115.6
260  126.7
280  137.8
300  148.9
 

root@iZuf6evbev3w2mqyyrgfcqZ:~/codec# more file.c
#include <stdio.h>
int main()
{
    int c;
    c = getchar();
    while (c != EOF){
        putchar(c);
        c = getchar();
    }
}
root@iZuf6evbev3w2mqyyrgfcqZ:~/codec# cc file.c -o file.out
root@iZuf6evbev3w2mqyyrgfcqZ:~/codec# ./file.out
s
s
输入“s”,回车后输出“s”,按住Ctrl+C可退出。

root@iZuf6evbev3w2mqyyrgfcqZ:~/codec# ./file.out
1
1
0
0
^C
root@iZuf6evbev3w2mqyyrgfcqZ:~/codec# 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值