Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么输出有问题呀?

Posted by 231003198704093217 at 2008-10-15 14:44:30 on Problem 1552
#include<stdlib.h>   
#include<stdio.h>  
#include<iostream>
using namespace std;
void main()
{
	char str1[13],count[100];
	int str2[13];
	int i,j,k=0,c;
    cout<<"Please input 2 to 15 unique positive integers(number<99):"<<endl;
 do{k++;
	cin.getline(str1,13,'0');
	for(i=0;i<cin.gcount();i++)
		str2[i]=atoi("str1[i]");
	for(i=0;i<cin.gcount()-1;i++)
	{
		for(j=i+1;j<cin.gcount();j++)
		{
			if(str2[i]==2*str2[j]||str2[i]==(float)str2[j]/2)
				count[k]++;
		}
	}
	}
	while(str2[0]!=-1);
	for(c=1;c<k;c++)
	cout<<count[c]<<endl;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator