C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int value(int a[]){
int i[3]={},s,n[3]={},p[6]={};
for(i[0]=1;i[0]<5;i[0]++){
//memorize lowest value for 'straight'detection
if(!n[2]) n[2]=a[0];
//else if(n[2]>a[i[0]]) n[2]=a[i[0]];
if(n[2]>a[i[0]]) n[2]=a[i[0]];
printf("n[2]=%d\n",n[2]);
//---------------------------------------
//memorize array that has different value from first array (array a) and save it in an array (array p)
if(a[0]==a[i[0]]) n[0]++;
else{
p[i[1]]=a[i[0]];
//printf("%d ",p[i[1]]);
i[1]++;}
}
//printf("\n");
//----------------------------------------
//compare value of array p with its value of its first array then reconfigure the array value
while(i[1]>1){
s=i[1];
i[1]=0;
for(i[0]=1;i[0]<s;i[0]++){
if(p[0]==p[i[0]]){
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run