摘要:
多态存在的三个必要条件一、要有继承;二、要有重写;三、父类引用指向子类对象。代码部分:class A { public String show(D obj) { return ("A and D"); } public String show(A obj) { ... 阅读全文
摘要:
主要用来做数据备份,每次用完以后再跑一次脚本,又可以将文件夹下的所有文件拷贝到指定的文件夹内import os,sys,shutil;class cur_env: path = sys.path[0] #print(path) os.chdir(path)# copy files ... 阅读全文
摘要:
最近做的一个项目,系统log下会生成如下的log(部分):[2015-05-19 11:16:06] Processing File transfer configured from ship to shore....[2015-05-19 11:16:06] File Limit is = 204... 阅读全文
摘要:
1.打印输入中单词长度2.打印输入中各个字符出现频度的直方图#include #include #include #define IN 1#define OUT 0main(){ int nc, nw, count, state, input; int nclist[26]; ... 阅读全文
摘要:
1. 统计行数、单词数与字符数2. 单词认为是任何其中不包含空格、制表符或换行符的字符序列#include #include #define IN 1#define OUT 0main(){ int nl,nw,nc,input,state; nl = nw = nc = 0; s... 阅读全文
摘要:
1. 连续空格用一个空格替换2. 制表符用\t替换,换行符用\n替换,反斜杠用\\替换#include #include main(){ int input; while((input=getchar())!=EOF){ if(input == '\n'){ ... 阅读全文
摘要:
最近要开始使用HP Mobile Center,以下是我在官网上搜集的配置信息,包含软硬件。Reference: http://mobilecenterhelp.saas.hp.com/en/latest/mobilecenter_help/Default.htm#Welcome Page/HP M... 阅读全文
摘要:
包括统计字符,空格,制表符,换行符:#include #include main(){ /* count characters, spaces & lines in input */ double lines,chars,spaces,tabs; int input; ... 阅读全文
摘要:
借助于getchar 与putchar 函数,可以在不了解其它输入/输出知识的情况下编写出数量惊人的有用的代码。最简单的例子就是把输入一次一个字符地复制到输出,其基本思想如下:读一个字符while (该字符不是文件结束指示符)输出刚读入的字符读下一个字符将上述基本思想转换为C语言程序为:#inclu... 阅读全文
摘要:
开始看C语言,主要是复习,所以就没必要从hello world开始了,写点例子熟悉下就好了。使用公式℃=(5/9)(℉-32)打印下列华氏温度与摄氏温度对照表:#include #include main(){ // c = (5/9)(f-32) int low,high,... 阅读全文