写下你上课、上机时碰到的疑难问题,我会及时给大家回复,希望同学门积极参与!
posted on 2008-03-24 09:07
ms_dos 阅读(65)
评论(4) 编辑 收藏 引用 网摘 所属分类:
C++答疑区
FeedBack:
# re: C++答疑请到这里! 2008-03-24 09:08
#include<iostream.h>
void main()
{
int a,b,t;
cout<<"input a:"; cin>>a;
cout<<"input b:"; cin>>b;
if(a>b)
{
t=a;
a=b;
b=t;
}
cout<<a<<','<<b<<'\n';
}
回复 更多评论
# re: C++答疑请到这里! 2008-03-24 09:11
# re: C++答疑请到这里! 2008-03-24 09:12
# 请老师具体说下此程序的具体执行步骤,谢谢
2008-03-25 23:11
#include<iostream>
void main()
{char *str="12123434";
int x1=0,x2=0,x3=0,x4=0,i;
for(i=0;str[i]!='\0';i++)
switch (str[i])
{case'1':x4++;
case'2':x3++;
case'3':x2++;
case'4':x1++;
}
cout<<x1<<","<<x2<<","<<x3<<","<<x4;
}
回复 更多评论