Let $n$ be a positive integer and $A=\{ 1,2,\ldots ,n\}$. A subset of $A$ is said to be connected if it consists of one element or several consecutive elements. Determine the maximum $k$ for which there exist $k$ distinct subsets of $A$ such that the intersection of any two of them is connected.
1. **Define the problem and initial setup:**
   Let \( n \) be a positive integer and \( A = \{1, 2, \ldots, n\} \). A subset of \( A \) is said to be connected if it consists of one element or several consecutive elements. We need to determine the maximum \( k \) for which there exist \( k \) distinct subsets of \( A \) such that the intersection of any two of them is connected.

2. **Establish a lower bound:**
   We can achieve \( k = \left\lfloor \frac{n + 1}{2} \right\rfloor \cdot \left\lceil \frac{n + 1}{2} \right\rceil \) by taking the set of intervals of the form \([i, j]\) with \( i \leq \left\lfloor \frac{n + 1}{2} \right\rfloor \leq j \).

3. **Prove the tightness of the bound:**
   For any subset \( X \subset A \), define \( f(X) \) to be the smallest interval containing \( X \), i.e., the interval \([\min(X), \max(X)]\). Observe that for two sets \( X \) and \( Y \), if \(\min X = \min Y\) and \(\max X = \max Y\) and \( X \cap Y \) is an interval, then necessarily \( X = f(X) = Y \). Consequently, if \( X \) and \( Y \) are two sets from our collection, we must have \( f(X) \neq f(Y) \).

4. **Replace each set with its interval:**
   Replace every set \( X \) in our collection with the set \( f(X) \). These sets are all intervals and every pair intersects, so every pair intersects in an interval. In particular, the modified collection satisfies our conditions.

5. **Reduce the problem to collections of intervals:**
   A collection of intervals with pairwise nonempty intersection actually has the property that the intersection of *all* elements in the collection is nonempty; in particular, it contains some point \( t \). Thus, a maximal collection is of the form "all the intervals containing point \( t \)." The size of such a collection is maximized when \( t = \left\lfloor \frac{n + 1}{2} \right\rfloor \) or \( t = \left\lceil \frac{n + 1}{2} \right\rceil \); in either case, the resulting collection has the size given above.

6. **Consider the variation with the empty set:**
   If we include the empty set as a connected subset, the same sort of argument applies. The resulting maximum size is \( \binom{n}{2} + \binom{n}{1} + \binom{n}{0} \), achieved when we include all intervals and the empty set in our collection.

The final answer is \( \boxed{ \left\lfloor \frac{n + 1}{2} \right\rfloor \cdot \left\lceil \frac{n + 1}{2} \right\rceil } \).