求大神帮我解释一下我代码中注释的那部分。怎么看都看不懂,感激不尽!
#include <stdio.h>
main()
{
int x,y,flag;
printf("please input a num x:\n ");
scanf("%d",&x);
flag=x<0?-1:(x<10?1:2);
//x是否小于0,是则flag=-1;否则flag=x<10?1:2,又进行判 断 x<10成立与否,成立则flag=1否则flag=2
switch(flag)
{
......................
阅读全部
|
lzj12530
贴于 2013年6月29日 22:22
hide
bbsi
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#define StuNum 30 //学生人数最大值
#define CourseNum 3 //科目数
struct student //定义结构数组
{
char studentID[10]; //学号
int score[CourseNum]; //成绩
......................
阅读全部
|
我爱C语言2
贴于 2013年6月26日 18:57
hide
bbsi
求大神帮我解释一下我代码中注释的那部分。怎么看都看不懂,感激不尽!
#include <stdio.h>
main()
{
int x,y,flag;
printf("please input a num x:\n ");
scanf("%d",&x);
flag=x<0?-1:(x<10?1:2);/*求解释*/
switch(flag)
{
case -1:y=x;break;/*求解释case是什么意思*/
......................
阅读全部
|
cnliaowt
贴于 2013年6月26日 13:51
hide
bbsi
#include<stdio.h>
#include<conio.h>
#include<time.h>
void print_f() /*初始化子函数*/
{
printf("21 hits game\n");
printf("\n");
srand(time(0)); /*用时间作为随机子*/
printf("You have 20 dollars.\n"); /*预充钱币20美元*/
}
int f1(int a,int b) /*当点数不为10时候的扑克牌显示*/
{
......................
阅读全部
|
天然呆的新一
贴于 2013年6月25日 21:45
hide
bbsi
#include<stdio.h>
#include<conio.h>
#include<time.h>
void print_f() /*初始化子函数*/
{
printf("21 hits game\n");
printf("\n");
srand(time(0)); /*用时间作为随机子*/
printf("You have 20 dollars.\n"); /*预充钱币20美元*/
}
int f1(int a,int b) /*当点数不为10时候的扑克牌显示*/
{
......................
阅读全部
|
天然呆的新一
贴于 2013年6月25日 21:42
hide
bbsi
#include<stdio.h>
void main()
{
void sort(array[],int n;
int array[10],i;
printf("enter the array:\n");
for (i=0;i<10;i++)
scanf("%d",&array);
printf ("enter sort arry:\n");
for (i=0;i<10;i++)
printf ("%d",&array);
getch()
......................
阅读全部
|
新人张
贴于 2013年6月25日 10:49
hide
bbsi
#include <stdio.h>
#include<stdlib.h>
{
int main()
{
Ltable *p;
DataType tem;
Ltableinit(&p); //初始化邻接表;
int n,c;
printf("本程序由电子商务10级2班孙印民、续琳琳、王倩共同开发,欢迎使用!\n") ;
while (1)
{
......................
阅读全部
|
燃烧的小虫
贴于 2013年6月24日 20:38
hide
bbsi
在数据库的插入操作中,出现以下错误的原因(但要添加的数据可以添加到数据库中)
org.apache.jasper.JasperException: javax.servlet.ServletException: com.microsoft.sqlserver.jdbc.SQLServerException: 结果集已关闭。
javax.servlet.ServletException: com.microsoft.sqlserver.jdbc.SQLServerException: 结果集已关闭。
com.microsoft.sqlserver.jdbc.SQLServerException: 结果集已关闭。
求大神帮忙!!!!
阅读全部
|
周丽娟
贴于 2013年6月24日 10:32
hide
bbsi
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
typedef struct student
{
char num[6];
char name[8];
int English;
int math;
int tax;//名次
int score;
struct student *next;
......................
阅读全部
|
小朴少
贴于 2013年6月23日 23:45
hide
bbsi