Saratov State University :: Online Contester


::Go
- home
- news
- register
- update personal info
- problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- links
- projects

::Poll
Are you registered on Codeforces?
Yes
No
What is it???

[results]

::webboard

Presentation Error
Author: TRT
ID: 064031
Problem: 102
Contest: 0
Date: 2014-10-24 13:33:58

I'm getting presentation error on this problem. Can anybody please help me out?
This is my code for problem 102:



#include <iostream>
#include <fstream>
using namespace std;

int N;

void read(){
ifstream _file("102.txt");
_file >> N;
_file.close();
return;
}

void prime(int& start, int& count){
int a = N;
int b = start;
int t;
while (b != 0){
t = b;
b = a%b;
a = t;
}
if (a == 1)
++count;
}


int main(){
read();
if (N <= 2){
ofstream _file("output.txt");
_file << 1;
_file.close();
return 0;
}
int count = 0;
for (int i = N-1; i > 0; --i){
prime(i, count);
}
ofstream _file("output.txt");
_file<<count;
_file.close();
return 0;
}

see sub-tree reply to that message


::Login
Forgot password?

::News
22.10.12 - The problems from the Southern Subregional Programming Contest 2012 added to the problemset archive (542 - 553).
22.10.12 - After the start of the contest the statements in PDF will be available by the link.
23.10.11 - The problems from the Southern Subregional Programming Contest 2011 added to the problemset archive (530 - 541).

::Counter

Server time: 2017-11-23 04:26:49Online Contester Team © 2002 - 2016. All rights reserved.