1 solutions

  • 0
    @ 2023-12-20 20:10:54
    #include <iostream>
    #include <bits/stdc++.h>
    #include <math.h>
    using namespace std;
    
    int main()
    {
    	int n;
    	int flag = 1;
    	cin >> n;
    	if(n == 1){
    		flag = 0;
    	}else if(n == 2){
    		flag = 1;
    	}else{
    		for(int i = 3 ;i < sqrt(n) ;i++){
    			if(n%i == 0){
    				flag = 0;
    				break;
    			}
    		}
    	}
    	
    	if(flag == 1){
    		cout << "T";
    	}else{
    		cout << "F";
    	}
    	return 0;
    }
    

    Information

    ID
    356
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    8
    Tags
    # Submissions
    266
    Accepted
    51
    Uploaded By