UVA 10217 A Dinner with Schwarzenegger!!!

#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main()
{
  int n;
  while(cin>>n)
  {
    printf("%.2lf ",(-1+sqrt(4*n+1))/2.0);
    cout<<(int)((1+sqrt(4*n+1))/2)<<endl;
  }
  return 0;
}

你可能感兴趣的:(uva,数学思维)