Monday, May 1, 2017

URI Solution 1216 Getline One - Solution in C++ | Ad Hoc

URI Solution 1216 Getline One - Solution in C++ | Ad Hoc


URI Online Judge Solution  Getline One | Ad Hoc
URI Main Problem Link - https://www.urionlinejudge.com.br/judge/en/problems/view/1216

Problem Name: URI Problem Getline One
Problem Number : URI - 1216
Online Judge : URI Online Judge Solution
Level: Ad Hoc
Solution Language : C plus plus


URI Solution 1216 Code in CPP:


#include <iostream>
#include <cstdio>
#include <iomanip>
using namespace std;

int main()
{
 double counter = 0, tmp = 0, res, x;
 string trash;
 char c;

 while(getline(cin,trash))
 {
  cin >> x;
  c = getchar();
  tmp += x;
  counter++;
 }

 res = tmp / counter;

 cout << fixed << setprecision(1) << res << endl;

 return 0;
}


No comments:
Write comments

To know more about the problem, give us your valuable commment. We'll try to help you. Thanks

All rights reserved ©2016 -URI ONLINE JUDGE SOLUTION | Developed by Maniruzzaman Akash

© 2016 URI ONLINE JUDGE SOLUTION. Developed by Maniruzzaman Akash | Distributed By Gooyaabi Templates
Powered by Blogger.