Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions cforcount
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <cstdlib>
#include <iostream>
/*for positives*/
using namespace std;
int CountDel (int a)
{
int count=0;
for (int i=1;i<a+1;i++)
{if (a%i==0)
{count++;}
}
return count;
}
int main(int argc, char *argv[])
{ int x;
int a[100];
int n=0;
int b;
cin >> b;
while (b!=0)
{ a[n]=b;
n++;
cin >> b;
}
for (int i=1;i<n;i++)
{
cout <<a[i]<<" ==>"<<CountDel(a[i])<<"\n";}
system("PAUSE");
return EXIT_SUCCESS;
}