#include <stdio.h>#include <stdlib.h>#include <math.h>#define MAX 20struct tagInfo{ char owner[MAX]; char object[MAX]; int id;};struct tre //TRE = Tag Read Event{ int id; char node[MAX]; int dx;};void initTag(struct tagInfo tag[], int numTags){ for(int i=0; i<numTags; i++) { printf("Enter the tag ID number: "); scanf("%i", &tag[i].id); printf("Enter owner of tag: "); scanf("%c", &tag[i].owner); printf("Enter the object the tag is attached to: "); scanf("%c", &tag[i].object); }}void generateTRE(struct tre event[], int numEvents){ for(int i=0; i<numEvents; i++) { printf("Enter tag ID: "); scanf("%i", &event[i].id); printf("Enter node: "); scanf("%c", &event[i].node); printf("Enter distance from node as an integer number of feet: "); scanf("%c", &event[i].dx); }}void triangulationSimulate(struct tre event1, struct tre event2, int numEvents){ if(numEvents>1 && event1.id==event2.id) { printf("Node %c", event1.node); for(int i=0; i<event1.dx; i++) { printf(" "); } printf("Tag %i", event1.id); for(int i=0; i<event2.dx; i++) { printf(" "); } printf("Node %c", event2.node); }}void getTagInfo(struct tagInfo tag){ printf("The tag with ID %i represents a/an %c belonging to %c", tag.id, tag.object, tag.owner);}
慕神8447489
鸿蒙传说