c# datalist里的eavl显示图片的问题

来源:百度知道 编辑:UC知道 时间:2024/05/15 17:27:15
<%# Eval("xiaoqupic1")==""?"":"<img src='xiaoqupic1'>" %>

我的意思是,如果xiaoqupic1不等于空,则显示图片xiaoqupic1。

LZ,你前面输入数:
1 回车
这时1已经作为输入,但"回车"仍是在输入流中
当你运行到scanf("%c",&c);回导入"回车",故就不用你再导入了
修复该程序如下:

#include<stdio.h>
#define N 5
main()
{
int i,j,number,top,bott,mid,loca,a[N],flag=1,sign=1;
char c;
printf("Enter data:\n");
scanf("%d",&a[0]);
i=1;
while(i<N)
{
scanf("%d",&a[i]);
if(a[i]>=a[i-1])
i++;
else
printf("Enter this data again:");
}
printf("\n");
for(i=0;i<N;i++)
printf("%4d",a[i]);
printf("\n");
flag=1;
while(flag)
{
printf("Input number to look for:");
scanf("%d",&number);
loca=0;
top=0;
bott=N-1;
if((number<a[0])||(number>a[N-1]))
loca=-1;
while((sign==1)&&(top<=bott))
{
mid=(bott+top)/2;
if(number==a