随笔分类 -  c语言

摘要:程序一 #define _________ } #define ________ putchar #define _______ main #define _(a) ________(a); #define ______ _______(){ #define __ ______ _(0x48)_(0x65)_(0x6C)_(0x6C) #define ___ _(0x6F)_(0x2C)_(0x20)_(0x77)_(0x6F) #define ____ _(0x72)_(0x6C)_(0x64)_(0x21) #define _____ __ ... 阅读全文
posted @ 2013-09-03 09:13 时间淡无痕 阅读(286) 评论(0) 推荐(0)
摘要:// student.cpp : 定义控制台应用程序的入口点。// #include"stdafx.h" #include<stdio.h> #include<string.h> struct student { char name[20]; int age; char sex; int nomber; float score; char telephone[100]; }; int main() { struct student stu1; strcpy(stu1.name,"杨文杰"); strcpy(stu1.telepho 阅读全文
posted @ 2013-06-01 10:16 时间淡无痕 阅读(162) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> int main() { char ch; //scanf("%c",&ch); ch=getchar(); switch(ch) { case 'A':printf("成绩为90分以上\n");break; case 'B':printf("成绩在80-90分之间\n");break; case 'C':printf("成绩在70-80分之间\n");bre 阅读全文
posted @ 2013-06-01 10:14 时间淡无痕 阅读(211) 评论(0) 推荐(0)
摘要:比如方程式ax*x+bx+c=0;其中需要讨论的情况有以下几种:1、a=0时不是二次方程;2、b*b-4*a*c=0,有两个相等实根;3、b*b-4*a*c>0,有两个不等实根;4、b*b-4*a*c<0,有两个共轭复根; 代码实现如下#include<stdio.h> #include<math.h> int main() { float a,b,c,disc,x1,x2,realpart,imagpart; scanf("%f%f%f",&a,&b,&c); printf("The equation& 阅读全文
posted @ 2013-06-01 10:12 时间淡无痕 阅读(220) 评论(0) 推荐(0)