易截截图软件、单文件、免安装、纯绿色、仅160KB

C_使用switch语句

 源码:
# include <stdio.h>
 
int main()
{
    int num;
    /* 下面定义的各变量,分别代表个位,十位,百位,千位,万位,十万位以及位数 */
    int indiv, ten, hundred, thousand; 
    int ten_thousand, hundred_thousand, place;
 
    printf("请输入一个整数(0~999999):");
    scanf("%d", &num);
 
    /* 判断变量num的位数 */
    if(num > 99999)
        place = 6;
    else if(num > 9999)
        place = 5;
    else if(num > 999)
        place = 4;
    else if(num > 99)
        place = 3;
    else if(num > 9)
        place = 2;
    else
        place = 1;
    printf("place = %d\n", place);
     
    printf("每位数字为:");
 
    /* 求出num在各位上的值 */
    hundred_thousand = num/100000;
    ten_thousand = (num - hundred_thousand*100000)/10000;
    thousand = (num - hundred_thousand*100000 - ten_thousand*10000)/1000;
    hundred = (num - hundred_thousand*100000 - ten_thousand*10000 
              - thousand*1000)/100;
    ten = (num - hundred_thousand*100000 - ten_thousand*10000 
          - thousand*1000 - hundred*100)/10;
    indiv = num - hundred_thousand*100000 - ten_thousand*10000 
            - thousand*1000 - hundred*100 - ten*10;
 
    /* 判断变


相关文档:

smartgwt (C)

   SmartGWT是一个利用GWT封装SmartClient的开源项目。类似于GWT-Ext。SmartClient是一个企业级的ajax框架,包括非常出色的UI库、工具库和客户端服务端数据绑定等功能。(引用)
  UI库:很多框架的UI库很出色,考虑的很完善,浏览器兼容性也很好,但往往只是前台的,当你想深入做点应用时,就会发现和后台 ......

c#与c、java的关系

 C#从Java继承而来的特点
  类:在C#中类的申明与Java很相似.这是合理的因为经验告诉我们Java模型工作得很好.Java的关键字import已经被替换成using,它起到了同样的作用.一个类开始执行的起点是静态方法Main().下面的Hello World程序展示了基本的形式:
  using System;
  class Hello
  {
  static v ......

C_数据类型转换

 源码:
# include <stdio.h>
 
int main()
{
    /* 定义变量并赋初值 */
     int    a = 5;       
    char   c = 'a';   // 'a'的ASC码的值为97
    ......

C_自增与自减

 源码:
# include <stdio.h>
 
int main()
{
    int i, j, k;
    int m, n, p;
 
    i = 8;
    j = 10;
    k = 12;
    
    /* 自增在操作数之前 */
   ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号