初学C++,发一个刚刚写的小东西顺便请大家以后多多指教!!!
#include <iostream>using namespace std;
int main()
{
int num,count1=0,count2=0;
double svm=1.0;
cout<<"flyfish"<<endl;
cout<<"输入几个整数,以0结束"<<endl;
cin>>num;
while(num!=0)
{
svm=svm*num;
if (num>0)
count1++;
else
count2++;
cin>>num;
}
{
cout<<"正数:"<<count1<<endl;
cout<<"负数:"<<count2<<endl;
cout<<"积是:"<<svm<<endl;
}
return 0;
}
大家以后多多指教啊,发现C++还真的停难的,不过也很强大,一定要学好C++的说加油