- 博客(13)
- 收藏
- 关注
转载 面向过程和面向对象的比较
Q:面向对象和面向过程的优缺点,结合实例进行阐述A:一、个人理解,面向对象相对于面向过程较显著的优势莫过于可扩展性、可维护性。众所周知在软件开发过程中,开发人员与客户需要不断的沟通,而客户的需求也往往在不断的变化,软件的功能也不是一成不变的。如果采用面向过程的方法来进行软件开发,当用户需求发生变化时,比如要求修改现有软件功能的实现方式或者要求追加新的功能时,就需要自顶向下地修改模块的结构,
2013-09-25 20:52:44 707
原创 Bubble Sort
// Bubble Sort#includeint main(void){ int a[10]; int i,j,t; printf("Pls input 10 numbers:\n"); for (i = 0; i < 10; i++) scanf("%d",&a[i]); printf("\n"); for (j = 0; j < 9; j++) { for (i
2013-09-25 19:17:39 456
原创 Find the sum of S = a + aa + aaa + aaaa + aaaaa +......+ aaa...aaa +...
// Find the sum of S = a + aa + aaa + aaaa + aaaaa +......+ aaa...aaa +...#include#includevoid main(){ int a, i, n; long s = 0, sum = 0; printf("Please input the value of a and n :\n"); scanf
2013-09-21 21:28:12 1360
原创 Two Methods of Finding the sum of 1! + 2! +3! + 4! +...+ 20!
My Method: // Find the sum of 1! + 2! +3! + 4! +...+ 20!int term(int r){ int i; long t = 1; for (i = 1; i <= r; ++i) t = t * i; return t;}#includevoid main(){ int j, n = 20; long
2013-09-21 20:34:29 735 2
原创 Count the number of alphabets, spaces, digits and other characters in one line character
// Count the number of alphabets, spaces, digits and other characters in one line character#includevoid main(){ char c; int i = 0 ,j = 0, m = 0, n = 0; printf("Please input one line characters:
2013-09-21 17:05:12 1208
原创 Telegram Encoding and Decoding
// Telegram Encoding#includevoid main(){ char c; while((c = getchar()) != '\n') { if((c >= 'a' && c = 'A' && c <= 'Z')) { c = c + 4; if ((c > 'z') || (c < 'z' && c <= 'Z'-4)) c =
2013-09-18 17:28:51 812
转载 谈谈工科学生如何学习数学
谈谈工科学生如何学习数学 邹谋炎 (中国科学院研究生院暑期讲座材料) 不少工科学生特别是工科研究生对数学基础不足感到压力。确实,缺乏数学的帮助会使得学生们的研究缺乏思路和工具,缺乏捕捉问题的敏感性,缺乏抽取问题本质的能力,缺乏处理问题的技巧和
2013-09-18 15:12:18 1865
原创 为什么计算机网络要采用分层结构
为什么计算机网络要采用分层结构?1)各层之间相互独立:高层是不需要知道底层的功能是采取硬件技术来实现的,它只需要知道通过与底层的接口就可以获得所需要的服务; 2)灵活性好:各层都可以采用最适当的技术来实现,例如某一层的实现技术发生了变化,用硬件代替了软件,只要这一层的功能与接口保持不变,实现技术的变化都并不会对其他各层以及整个系统的工作产生影响; 3)易于实现和
2013-09-18 15:00:54 34976
原创 Two Minor Questions
Question 1:We would like to assign rooms for students. Assume there are x students, each room could accommodate 6 students. Use one formula to find out how many rooms we needed in total.Ans
2013-09-17 22:35:41 650
原创 Find all the prime number between 1 and 100
/* Find all the prime number between 1 and 100 */#include#includeint main(){int i,n,j = 0;for (n = 2; n <= 100; ++n){bool isPrime = true;for (i = 2; i {if (n % i
2013-09-17 22:32:07 1248
原创 Exchange the numbers of row and array of a two-dimensional array, and form a new two-dimensional ar
// Exchange the numbers of row and array of a two-dimensional array, and form a new two-dimensional array#includevoid main(){ int a[2][3]={{1,2,3},{4,5,6}}; int b[3][2],i,j; printf("arrary a:\n"
2013-09-17 21:16:47 760
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人