int main()
{
    int *arr, size, sum;
    printf("Enter size of the array\n");
    scanf("%d", &size);
    printf("Enter elements in array\n");
    for(int index = 0; index < size; index++)
        scanf("%d", &arr[index]);
    printf("Enter the value of sum\n");
    scanf("%d", &sum);
    if(!findTriplet(arr, size, sum))
    printf("Triplet not found");
    return 0;
}
示例#2
0
文件: 9.c 项目: mehunter/euler
int main (int argc, char* argv[]) {
  if (argc == 2) {
    int perimeter;
    perimeter = atoi(argv[1]);
    findTriplet(perimeter);
  }

  else {
    printf("This program requires a command line argument for the perimeter\n");
    printf("of the right triangle, a + b + c.\n");
  }

  return 0;
}