zoukankan      html  css  js  c++  java
  • chapter3习题

    // 2013年11月4日21:47:21
    # include <stdio.h>
    # include <math.h>
    int main()
    {
    	int n; 
    	double	p, r;
    	scanf("%d%lf", &n, &r);
    
    	p = pow((1+r), n);
    
    	printf("%lf
    ", p);
    	return 0;
    }
    /*
    --------------------------------------
    在VC++6.0中的输出结果是:
    10 0.09
    2.367364
    Press any key to continue
    --------------------------------------
    */

    //	2013年11月5日13:18:59
    
    # include <stdio.h>
    int main()
    {
    //	char c1, c2;
    	/*
    	c1 = 97;    当输入这些值得时候,输出结果为,a,b; 97,98   出现这个结果的原因是,%c是以字符的形式输出,而%d则是以一个十进制整数输出
    	c2 = 98;
    	*/
    
    	/*
    	c1 = 197;   在这里输入的结果为,?,?; -59,-58
    	c2 = 198;	出现这个结果的原因是因为,ASCII一般只用7位,也就是128个字符,超过的话,则无法显示,而用十进制显示的时候,则直接字符运算
    	*/
    
    	/*
    	int c1, c2;		当用int来取代char的时候,用%c依然是没有符号对应,而用十进制输出的时候,可以输出,十进制的值
    	c1 = 197;
    	c2 = 198;
    	*/
    	printf("c1 = %c, c2 = %c
    ", c1, c2);
    	printf("c1 = %d, c2 = %d
    ", c1, c2);
    
    	return 0;
    }

    // 2013年11月5日13:40:47
    # include <stdio.h>
    int main()
    {
    	int a, b; 
    	float x, y;
    	char c1, c2; 
    	scanf("a=%db=%d", &a, &b);
    	scanf("%f%e", &x, &y);
    	scanf("%c%c", &c1, &c2);
    
    	printf("a = %d, b= %d, x = %f, y = %e, c1 = %c, c2 = %c
    ", a, b, x, y, c1, c2);
    
    	return 0;
    }
    /*  
    -----------------------------------------
    在VC++6.0中的输出结果是:
    a=3b=7
    8.5 71.82Aa
    a = 3, b= 7, x = 8.500000, y = 7.182000e+001, c1 = A, c2 = a
    Press any key to continue
    
      这个里面必须要记住,Aa必须要紧跟着71.82输入
    ----------------------------------------
    */

    // 2013年11月5日21:37:36
    // 编码
    # include <stdio.h>
    int main()
    {
    	char c1, c2, c3, c4, c5;
    	scanf("%c%c%c%c%c", &c1, &c2, &c3, &c4, &c5);
    	c1 = c1 + 5;
    	c2 = c2 + 5;
    	c3 = c3 + 5;
    	c4 = c4 + 5;
    	c5 = c5 + 5;
    
    	printf("%c%c%c%c%c
    ", c1, c2, c3, c4, c5);
    
    	return 0;
    }

  • 相关阅读:
    兼容IE的滚动条自定义样式
    vue从入门到开发--4--处理http请求
    vue从入门到开发--3-基础语法
    Oracle 扩容表空间
    Oracle 整库备份还原
    Oracle 相关命令
    更改mysql数据库根目录
    关于文件系统
    挂载iscsi存储
    挂载nfs存储
  • 原文地址:https://www.cnblogs.com/zhurun/p/4590556.html
Copyright © 2011-2022 走看看