落書きノート

ふと自分が気になった事を書いてます

C++で不定期練習 AIZU ONLINE JUDGE

// A/B Problem

#include <iostream>

using namespace std;

int main(void) {
  int a,b;
  cin >> a >> b;
  int d = a / b;
  int r = a % b;
  double f = (double)a / b;
  cout << d << " " << r << " " << fixed << f << endl;
  return 0;
}

// Circle

#include <iostream>
#include <cmath>

using namespace std;

int main(void) {
  double r;
  cin >> r;
  cout << fixed << r * r * M_PI << " " << 2 * r * M_PI << endl;
  return 0;
}