View Code of Problem 31

#include <iostream>
#include<stdio.h>
#include<math.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {

	/*
		long long int k ;
		
		//找出第k个被3,5,7除的时候,余数为2,3,2的数——
		long long int count = 0;
		long long int num = 1;
		while( scanf("%lld" , &k) !=EOF ) {
			if( num % 3 == 2 && num % 5 ==3 && num % 7 ==2   )
				count++;
			if(count == k) {
				printf("%lld" , num);
				break ;
			}
			num++;
		}

	long int k,ans;
	while(scanf("%ld",&k)!=EOF){
		ans=23+105*(k-1);
		printf("%ld\n",ans);
	}
	
	*/
	
	long long int k , num;
	while( scanf("%lld", &k) != EOF){
		num = 23 + 3 * 5 * 7 * (k - 1);
		printf("%lld\n" , num);
	}


	return 0 ;
}












Double click to view unformatted code.


Back to problem 31