UVA Problem 10110 Solution

UVA Problem 10110 Solution

#include <bits/stdc++.h> using namespace std; int main() { long long int n; while(cin>>n) { if(n==0) break; long long int n1=sqrt(n); if((n1*n1)==n) { cout<<"yes"<<endl; } else cout<<"no"<<endl; } return 0; }...

UVA Problem 10260( Soundex Solution) Solution

UVA Problem 10260( Soundex Solution) Solution

#include<bits/stdc++.h> using namespace std; int main() { char s[120]; int l,i; while(gets(s)) { l=strlen(s); for(i=0;i<l;i++) { if(s[i]=='B' || s[i]=='F' || s[i]=='P' || s[i]=='V') { if(s[i+1]!='B' && s[i+1]!='F' && s[i+1]!='P' &&...

UVA Problem 10302 Solution

UVA Problem 10302 Solution

#include <bits/stdc++.h> using namespace std; int main() { long long int k,sum,i,j; while(scanf("%lld",&k)==1 && k) { sum=(k*k*(k+1)*(k+1))/4; printf("%lld\n",sum); } return 0; }  

UVA Problem 10325 (The Lottery) Solution

UVA Problem 10325 (The Lottery) Solution

#include <bits/stdc++.h> using namespace std; int check_prime (long int n) { int i; for ( i = 2; i * i <= n; i++) { if (n % i == 0) return 0; } return 1; } int rev(int n) { int reverse=0, rem; while(n) { rem=n%10; reverse=reverse*10+rem; n/=10; } return...

UVA Problem 10327 (Flip Sort) Solution

UVA Problem 10327 (Flip Sort) Solution

#include <bits/stdc++.h> using namespace std; int main() { int n, array[5000],k, c,count,d,T, t; while(scanf("%d",&n)==1) { count=0; for (c = 0; c < n; c++) { cin>>array[c]; } for (c = 1 ; c <= n - 1; c++) { d = c; while ( d > 0 &&...

UVA Problem 10365(Blocks) Solution

UVA Problem 10365(Blocks) Solution

#include <bits/stdc++.h> using namespace std; int main() { int n,i,j,k,l,h,w,area,surface_area,tc; cin>>tc; while( tc-- ) { cin>>n; area=1000000; for(l=1;l<=n;l++) for(h=1;h<=sqrt(n);h++) for(w=1;w<=sqrt(n);w++) { if(l*h*w==n)//if it a cube...

UVA Problem 10370 (Above Average) Solution

UVA Problem 10370 (Above Average) Solution

#include <stdio.h> #include <math.h> int a[2000]; int main() { int t,n,i,j,sum,count,avg,ans; scanf("%d",&t); while(t--) { sum=0,count=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { sum+=a[i]; } avg=sum/n;...

UVA Problem 10394 (Twin Prims) Solution

UVA Problem 10394 (Twin Prims) Solution

#include <stdio.h> #include<iostream> #include<math.h> using namespace std; bool flag[20000005]; int primes[20000000]; int tprimes[20000000]; int cnt,m=0; void sieve(int n) { cnt=0; primes[cnt++]=2; for(int i=3; i<=n; i+=2) { if(flag[i] == 0) {...

UVA Problem 10424 (Love Calculator) Solution

UVA Problem 10424 (Love Calculator) Solution

#include <stdio.h> #include <iostream> #include <string.h> using namespace std; int main() { char s[100],len; int i,j,op,d,sum,ip=0,ip1,ip2; float result; while(gets(s)) { ip++; sum=0; len=strlen(s); for(i=0;i<len;i++) { if(s[i]=='a' || s[i]=='A')...

UVA Problem 10487(Closest Sum) Solution

UVA Problem 10487(Closest Sum) Solution

#include <stdio.h> int main() { int n, i, q, c, sz, idx, idx2, t1, t2, elteres, ce = 0; while(1) { scanf("%d",&n); if(!n) break; printf("Case %d:\n",++ce); int set[n], i = 0, q = 0; sz = n; while(n--) { scanf("%d",&set[i++]); } scanf("%d",&q);...

Cambridge IELTS 16 Test 3

Cambridge IELTS 16 Test 3

Reading Passage 1: Roman Shipbuilding and Navigation, Solution with Answer Key , Reading Passage 1: Roman Shipbuilding and Navigation IELTS Cambridge 16, Test 3, Academic Reading Module Cambridge IELTS 16, Test 3: Reading Passage 1 – Roman Shipbuilding and...

Cambridge IELTS 16 Test 2

Cambridge IELTS 16 Test 2

Reading Passage 1: The White Horse of Uffington, Solution with Answer Key The White Horse of Uffington IELTS Cambridge 16, Test 2, Academic Reading Module, Reading Passage 1 Cambridge IELTS 16, Test 2: Reading Passage 1 – The White Horse of Uffington...

Cambridge IELTS 15 Reading Test 4 Answers

Cambridge IELTS 15 Reading Test 4 Answers

PASSAGE 1: THE RETURN OF THE HUARANGO QUESTIONS 1-5: COMPLETE THE NOTES BELOW. 1. Answer: water Key words:  access, deep, surface Paragraph 2 provides information on the role of the huarango tree: “it could reach deep water sources”. So...

Cambridge IELTS 15 Reading Test 3 Answers

Cambridge IELTS 15 Reading Test 3 Answers

PASSAGE 1: HENRY MOORE (1898 – 1986 ) QUESTIONS 1-7: DO THE FOLLOWING STATEMENTS AGREE WITH THE INFORMATION GIVEN IN READING PASSAGE 1? 1. Answer: TRUE Key words: leaving school, Moore, did, father, wanted It is mentioned in the first paragraph...