Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
better o/p of factor problem
#include <bits/stdc++.h> using namespace std; int main() { vector<int>rahul; int n; cout<<"Enter the total no that you want to factor of: "<<endl; cin>>n; cout<<"Enter the numers you wnt to factor:"<<endl<<endl; for(int i=0;i<n;i++) {int x;cin>>x;rahul.push_back(x);} for(int j=0;j<n;j++) { cout<<"factor of "<<rahul[j]<<" is: "; for(int k=*max_element(rahul.begin(),rahul.end());k>=1;k--) { if(rahul[j]%k==0) cout<<rahul[j]/k<<" "; } cout<<endl; } return 0; }
run
|
edit
|
history
|
help
1
Guess Number
runtime template mode processor
PATRA_Class_test
MemCpyClass
std_minmax_unexpected_behaviour.cpp
ExceptionHandling3
Couting number of substring occurances in C++
Beadandó
TREAP RANGE QUERY (but it's runtime is not that good)
danger73